From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: Lee Jones <lee.jones@linaro.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sm501: Add device property
Date: Tue, 28 Jun 2016 23:32:20 +0900 [thread overview]
Message-ID: <87k2h9z8nf.wl-ysato@users.sourceforge.jp> (raw)
In-Reply-To: <20160628074908.GI6720@dell>
On Tue, 28 Jun 2016 16:49:08 +0900,
Lee Jones wrote:
>
> On Tue, 28 Jun 2016, Yoshinori Sato wrote:
>
> > This driver have configuration parameter "device" in platform_data.
> > But don't have it in devicetree.
> >
> > This patch add "device" configuration to devicetree.
>
> This is really ugly.
I don't know details, either, so it may be wrong.
> 1. Where are you documenting the binding?
It looks remove of commit 4295f9bf74a885da390abc49a3b42a011c1bb890.
Revert.
> 2. Just because it's in platform data, it doesn't mean it lives in DT
SM501's devicetree support only framebuffer module.
This property not needed only framebuffer.
> 3. Does this code even work?
> Won't private_platdata get freed when you leave probe()?
Yes. This code works RTS7751R2D (SH4).
> 4. Where is 'devices' consumed?
It used "sm501_init_dev".
I'll sent v2/
Thanks.
> > Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> > ---
> > drivers/mfd/sm501.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
> > index 65cd0d2..e2e3f9b 100644
> > --- a/drivers/mfd/sm501.c
> > +++ b/drivers/mfd/sm501.c
> > @@ -21,6 +21,7 @@
> > #include <linux/pci.h>
> > #include <linux/i2c-gpio.h>
> > #include <linux/slab.h>
> > +#include <linux/of.h>
> >
> > #include <linux/sm501.h>
> > #include <linux/sm501-regs.h>
> > @@ -1377,6 +1378,8 @@ static int sm501_plat_probe(struct platform_device *dev)
> > {
> > struct sm501_devdata *sm;
> > int ret;
> > + struct sm501_platdata private_platdata;
> > + struct sm501_initdata private_initdata;
> >
> > sm = kzalloc(sizeof(struct sm501_devdata), GFP_KERNEL);
> > if (sm == NULL) {
> > @@ -1388,6 +1391,12 @@ static int sm501_plat_probe(struct platform_device *dev)
> > sm->dev = &dev->dev;
> > sm->pdev_id = dev->id;
> > sm->platdata = dev_get_platdata(&dev->dev);
> > + if (!sm->platdata) {
> > + of_property_read_u32(dev->dev.of_node, "smi,devices",
> > + (u32 *)&private_initdata.devices);
> > + private_platdata.init = &private_initdata;
> > + sm->platdata = &private_platdata;
> > + }
> >
> > ret = platform_get_irq(dev, 0);
> > if (ret < 0) {
>
> --
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog
--
Yoshinori Sato
<ysato@users.sourceforge.jp>
next prev parent reply other threads:[~2016-06-28 14:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-28 6:59 [PATCH] sm501: Add device property Yoshinori Sato
2016-06-28 7:49 ` Lee Jones
2016-06-28 14:32 ` Yoshinori Sato [this message]
2016-06-28 14:33 ` [PATCH v2] " Yoshinori Sato
2016-06-29 8:16 ` Lee Jones
2016-06-29 8:17 ` Lee Jones
2016-06-29 16:09 ` Yoshinori Sato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k2h9z8nf.wl-ysato@users.sourceforge.jp \
--to=ysato@users.sourceforge.jp \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.