Message ID | 1498118047-11918-4-git-send-email-yamada.masahiro@socionext.com |
---|---|
State | New |
Headers | show |
Series | [1/5] dm: ofnode: use ofnode_read_bool() to check property existence | expand |
On 22 June 2017 at 01:54, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > The previous commit renamed ofnode_read_prop() to ofnode_get_propery() > and fixed its return type. Likewise, rename dev_read_prop() and fix > its return type. > > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> > --- > > drivers/core/read.c | 3 ++- > drivers/input/key_matrix.c | 4 ++-- > include/dm/read.h | 9 +++++---- > 3 files changed, 9 insertions(+), 7 deletions(-) Acked-by: Simon Glass <sjg@chromium.org>
Hi Masahiro, On 5 July 2017 at 22:49, Simon Glass <sjg@chromium.org> wrote: > On 22 June 2017 at 01:54, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >> The previous commit renamed ofnode_read_prop() to ofnode_get_propery() >> and fixed its return type. Likewise, rename dev_read_prop() and fix >> its return type. >> >> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> >> --- >> >> drivers/core/read.c | 3 ++- >> drivers/input/key_matrix.c | 4 ++-- >> include/dm/read.h | 9 +++++---- >> 3 files changed, 9 insertions(+), 7 deletions(-) > > Acked-by: Simon Glass <sjg@chromium.org> Actually I take that back. I'd like all functions in read.h to start with dev_read...(). Regards, Simon
Hi Simon, 2017-07-07 12:57 GMT+09:00 Simon Glass <sjg@chromium.org>: > Hi Masahiro, > > On 5 July 2017 at 22:49, Simon Glass <sjg@chromium.org> wrote: >> On 22 June 2017 at 01:54, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >>> The previous commit renamed ofnode_read_prop() to ofnode_get_propery() >>> and fixed its return type. Likewise, rename dev_read_prop() and fix >>> its return type. >>> >>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> >>> --- >>> >>> drivers/core/read.c | 3 ++- >>> drivers/input/key_matrix.c | 4 ++-- >>> include/dm/read.h | 9 +++++---- >>> 3 files changed, 9 insertions(+), 7 deletions(-) >> >> Acked-by: Simon Glass <sjg@chromium.org> > > Actually I take that back. I'd like all functions in read.h to start > with dev_read...(). > Do you want me to fix the return type?
Hi Masahiro, On 13 July 2017 at 20:38, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > Hi Simon, > > > 2017-07-07 12:57 GMT+09:00 Simon Glass <sjg@chromium.org>: >> Hi Masahiro, >> >> On 5 July 2017 at 22:49, Simon Glass <sjg@chromium.org> wrote: >>> On 22 June 2017 at 01:54, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >>>> The previous commit renamed ofnode_read_prop() to ofnode_get_propery() >>>> and fixed its return type. Likewise, rename dev_read_prop() and fix >>>> its return type. >>>> >>>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> >>>> --- >>>> >>>> drivers/core/read.c | 3 ++- >>>> drivers/input/key_matrix.c | 4 ++-- >>>> include/dm/read.h | 9 +++++---- >>>> 3 files changed, 9 insertions(+), 7 deletions(-) >>> >>> Acked-by: Simon Glass <sjg@chromium.org> >> >> Actually I take that back. I'd like all functions in read.h to start >> with dev_read...(). >> > > Do you want me to fix the return type? Yes void * would be better I suppose. Also what happened with that patch with the DEBUG problem? Regards, Simon
Hi Simon, 2017-07-14 23:20 GMT+09:00 Simon Glass <sjg@chromium.org>: > Hi Masahiro, > > On 13 July 2017 at 20:38, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >> Hi Simon, >> >> >> 2017-07-07 12:57 GMT+09:00 Simon Glass <sjg@chromium.org>: >>> Hi Masahiro, >>> >>> On 5 July 2017 at 22:49, Simon Glass <sjg@chromium.org> wrote: >>>> On 22 June 2017 at 01:54, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >>>>> The previous commit renamed ofnode_read_prop() to ofnode_get_propery() >>>>> and fixed its return type. Likewise, rename dev_read_prop() and fix >>>>> its return type. >>>>> >>>>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> >>>>> --- >>>>> >>>>> drivers/core/read.c | 3 ++- >>>>> drivers/input/key_matrix.c | 4 ++-- >>>>> include/dm/read.h | 9 +++++---- >>>>> 3 files changed, 9 insertions(+), 7 deletions(-) >>>> >>>> Acked-by: Simon Glass <sjg@chromium.org> >>> >>> Actually I take that back. I'd like all functions in read.h to start >>> with dev_read...(). >>> >> >> Do you want me to fix the return type? > > Yes void * would be better I suppose. Also what happened with that > patch with the DEBUG problem? > Why do you need dm_dbg() instead of generic debug() or pr_debug()?
Hi Masahiro, On 16 July 2017 at 21:29, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > Hi Simon, > > 2017-07-14 23:20 GMT+09:00 Simon Glass <sjg@chromium.org>: >> Hi Masahiro, >> >> On 13 July 2017 at 20:38, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >>> Hi Simon, >>> >>> >>> 2017-07-07 12:57 GMT+09:00 Simon Glass <sjg@chromium.org>: >>>> Hi Masahiro, >>>> >>>> On 5 July 2017 at 22:49, Simon Glass <sjg@chromium.org> wrote: >>>>> On 22 June 2017 at 01:54, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >>>>>> The previous commit renamed ofnode_read_prop() to ofnode_get_propery() >>>>>> and fixed its return type. Likewise, rename dev_read_prop() and fix >>>>>> its return type. >>>>>> >>>>>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> >>>>>> --- >>>>>> >>>>>> drivers/core/read.c | 3 ++- >>>>>> drivers/input/key_matrix.c | 4 ++-- >>>>>> include/dm/read.h | 9 +++++---- >>>>>> 3 files changed, 9 insertions(+), 7 deletions(-) >>>>> >>>>> Acked-by: Simon Glass <sjg@chromium.org> >>>> >>>> Actually I take that back. I'd like all functions in read.h to start >>>> with dev_read...(). >>>> >>> >>> Do you want me to fix the return type? >> >> Yes void * would be better I suppose. Also what happened with that >> patch with the DEBUG problem? >> > > Why do you need dm_dbg() > instead of generic debug() or pr_debug()? I don't really understand the question, but debug() / pr_debug() are find. Regards, Simon
Hi Simon, 2017-07-28 13:19 GMT+09:00 Simon Glass <sjg@chromium.org>: > Hi Masahiro, > > On 16 July 2017 at 21:29, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >> Hi Simon, >> >> 2017-07-14 23:20 GMT+09:00 Simon Glass <sjg@chromium.org>: >>> Hi Masahiro, >>> >>> On 13 July 2017 at 20:38, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >>>> Hi Simon, >>>> >>>> >>>> 2017-07-07 12:57 GMT+09:00 Simon Glass <sjg@chromium.org>: >>>>> Hi Masahiro, >>>>> >>>>> On 5 July 2017 at 22:49, Simon Glass <sjg@chromium.org> wrote: >>>>>> On 22 June 2017 at 01:54, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >>>>>>> The previous commit renamed ofnode_read_prop() to ofnode_get_propery() >>>>>>> and fixed its return type. Likewise, rename dev_read_prop() and fix >>>>>>> its return type. >>>>>>> >>>>>>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> >>>>>>> --- >>>>>>> >>>>>>> drivers/core/read.c | 3 ++- >>>>>>> drivers/input/key_matrix.c | 4 ++-- >>>>>>> include/dm/read.h | 9 +++++---- >>>>>>> 3 files changed, 9 insertions(+), 7 deletions(-) >>>>>> >>>>>> Acked-by: Simon Glass <sjg@chromium.org> >>>>> >>>>> Actually I take that back. I'd like all functions in read.h to start >>>>> with dev_read...(). >>>>> >>>> >>>> Do you want me to fix the return type? >>> >>> Yes void * would be better I suppose. Also what happened with that >>> patch with the DEBUG problem? >>> >> >> Why do you need dm_dbg() >> instead of generic debug() or pr_debug()? > > I don't really understand the question, but debug() / pr_debug() are find. > In U-Boot, debug() is often used for debugging. My question was, why don't you use it in DM core too? (Then dm_dbg() will be unnecessary, I think.)
Hi Masahiro, On 28 July 2017 at 06:57, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > Hi Simon, > > > 2017-07-28 13:19 GMT+09:00 Simon Glass <sjg@chromium.org>: >> Hi Masahiro, >> >> On 16 July 2017 at 21:29, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >>> Hi Simon, >>> >>> 2017-07-14 23:20 GMT+09:00 Simon Glass <sjg@chromium.org>: >>>> Hi Masahiro, >>>> >>>> On 13 July 2017 at 20:38, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >>>>> Hi Simon, >>>>> >>>>> >>>>> 2017-07-07 12:57 GMT+09:00 Simon Glass <sjg@chromium.org>: >>>>>> Hi Masahiro, >>>>>> >>>>>> On 5 July 2017 at 22:49, Simon Glass <sjg@chromium.org> wrote: >>>>>>> On 22 June 2017 at 01:54, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: >>>>>>>> The previous commit renamed ofnode_read_prop() to ofnode_get_propery() >>>>>>>> and fixed its return type. Likewise, rename dev_read_prop() and fix >>>>>>>> its return type. >>>>>>>> >>>>>>>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> >>>>>>>> --- >>>>>>>> >>>>>>>> drivers/core/read.c | 3 ++- >>>>>>>> drivers/input/key_matrix.c | 4 ++-- >>>>>>>> include/dm/read.h | 9 +++++---- >>>>>>>> 3 files changed, 9 insertions(+), 7 deletions(-) >>>>>>> >>>>>>> Acked-by: Simon Glass <sjg@chromium.org> >>>>>> >>>>>> Actually I take that back. I'd like all functions in read.h to start >>>>>> with dev_read...(). >>>>>> >>>>> >>>>> Do you want me to fix the return type? >>>> >>>> Yes void * would be better I suppose. Also what happened with that >>>> patch with the DEBUG problem? >>>> >>> >>> Why do you need dm_dbg() >>> instead of generic debug() or pr_debug()? >> >> I don't really understand the question, but debug() / pr_debug() are find. >> > > > In U-Boot, debug() is often used for debugging. > > My question was, why don't you use it in DM core too? > (Then dm_dbg() will be unnecessary, I think.) I am not quite sure - perhaps Marek will remember. Regards, Simon
diff --git a/drivers/core/read.c b/drivers/core/read.c index c1fe949808fa..61fda9334a7c 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -104,7 +104,8 @@ int dev_read_phandle(struct udevice *dev) return fdt_get_phandle(gd->fdt_blob, ofnode_to_offset(node)); } -const u32 *dev_read_prop(struct udevice *dev, const char *propname, int *lenp) +const void *dev_get_property(struct udevice *dev, const char *propname, + int *lenp) { return ofnode_get_property(dev_ofnode(dev), propname, lenp); } diff --git a/drivers/input/key_matrix.c b/drivers/input/key_matrix.c index cd5bce361356..3669019cb9ff 100644 --- a/drivers/input/key_matrix.c +++ b/drivers/input/key_matrix.c @@ -144,7 +144,7 @@ int key_matrix_decode_fdt(struct udevice *dev, struct key_matrix *config) int proplen; uchar *plain_keycode; - prop = dev_read_prop(dev, "linux,keymap", &proplen); + prop = dev_get_property(dev, "linux,keymap", &proplen); /* Basic keymap is required */ if (!prop) { debug("%s: cannot find keycode-plain map\n", __func__); @@ -158,7 +158,7 @@ int key_matrix_decode_fdt(struct udevice *dev, struct key_matrix *config) if (!config->plain_keycode) return -1; - prop = dev_read_prop(dev, "linux,fn-keymap", &proplen); + prop = dev_get_property(dev, "linux,fn-keymap", &proplen); /* fn keymap is optional */ if (!prop) goto done; diff --git a/include/dm/read.h b/include/dm/read.h index 562881962a64..74d5490ad2ce 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -227,14 +227,15 @@ int dev_read_size_cells(struct udevice *dev); int dev_read_phandle(struct udevice *dev); /** - * dev_read_prop()- - read a property from a device's node + * dev_get_property()- - get a pointer to the value of a device's node * * @dev: device to check * @propname: property to read * @lenp: place to put length on success * @return pointer to property, or NULL if not found */ -const u32 *dev_read_prop(struct udevice *dev, const char *propname, int *lenp); +const void *dev_get_property(struct udevice *dev, const char *propname, + int *lenp); /** * dev_read_alias_seq() - Get the alias sequence number of a node @@ -386,8 +387,8 @@ static inline int dev_read_phandle(struct udevice *dev) return fdt_get_phandle(gd->fdt_blob, dev_of_offset(dev)); } -static inline const u32 *dev_read_prop(struct udevice *dev, - const char *propname, int *lenp) +static inline const void *dev_get_property(struct udevice *dev, + const char *propname, int *lenp) { return ofnode_get_property(dev_ofnode(dev), propname, lenp); }
The previous commit renamed ofnode_read_prop() to ofnode_get_propery() and fixed its return type. Likewise, rename dev_read_prop() and fix its return type. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> --- drivers/core/read.c | 3 ++- drivers/input/key_matrix.c | 4 ++-- include/dm/read.h | 9 +++++---- 3 files changed, 9 insertions(+), 7 deletions(-)