From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Roger Quadros <rogerq@ti.com>
Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
Tony Lindgren <tony@atomide.com>,
Lee Jones <lee.jones@linaro.org>,
Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: [3/3] mfd: omap-usb-host: Drop support for non-DT probe
Date: Wed, 12 Sep 2018 11:30:16 +0300 [thread overview]
Message-ID: <3845315.THatgfdZ0C@avalon> (raw)
Hi Roger,
On Wednesday, 12 September 2018 10:57:31 EEST Roger Quadros wrote:
> On 11/09/18 18:06, Laurent Pinchart wrote:
> > Now that all platforms using OMAP USB host devices have been converted
> > to DT, drop support for legacy non-DT probe from the driver.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >
> > drivers/mfd/omap-usb-host.c | 153 ++--------------------------
> > include/linux/platform_data/usb-omap.h | 4 -
> > 2 files changed, 13 insertions(+), 144 deletions(-)
> >
> > diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
> > index b731026541f5..ce28e0fda55e 100644
> > --- a/drivers/mfd/omap-usb-host.c
> > +++ b/drivers/mfd/omap-usb-host.c
[snip]
> > @@ -541,31 +424,28 @@ static const struct of_device_id
> > usbhs_child_match_table[] = {
> > static int usbhs_omap_probe(struct platform_device *pdev)
> > {
> > struct device *dev = &pdev->dev;
> > - struct usbhs_omap_platform_data *pdata = dev_get_platdata(dev);
> > + struct usbhs_omap_platform_data *pdata;
> > struct usbhs_hcd_omap *omap;
> > struct resource *res;
> > int ret = 0;
> > int i;
> > bool need_logic_fck;
> >
> > - dev_info(&pdev->dev, "%s\n", __func__);
> > - if (dev->of_node) {
> > - /* For DT boot we populate platform data from OF node */
> > - pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> > - if (!pdata)
> > - return -ENOMEM;
> > + /* Populate platform data from OF node */
> > + if (!dev->of_node) {
> > + dev_err(dev, "Missing OF node\n");
> > + return -ENODEV;
> > + }
> >
> > - ret = usbhs_omap_get_dt_pdata(dev, pdata);
> > - if (ret)
> > - return ret;
> > + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> > + if (!pdata)
> > + return -ENOMEM;
> >
> > - dev->platform_data = pdata;
> > - }
> > + ret = usbhs_omap_get_dt_pdata(dev, pdata);
> > + if (ret)
> > + return ret;
> >
> > - if (!pdata) {
> > - dev_err(dev, "Missing platform data\n");
> > - return -ENODEV;
> > - }
> > + dev->platform_data = pdata;
>
> Do we still need to set dev->platform_data?
>
> This driver can access it via
> struct usbhs_hcd_omap *omap = dev_get_drvdata(dev);
> omap->pdata;
Unfortunately we still do, as the ehci-omap driver accesses the omap-usb-host
device platform data (through the ehci-omap device's parent).
> > if (pdata->nports > OMAP3_HS_USB_PORTS) {
> > dev_info(dev, "Too many num_ports <%d> in platform_data. Max %d\n",
> >
> > @@ -798,13 +678,6 @@ static int usbhs_omap_probe(struct platform_device
> > *pdev)
> > goto err_mem;
> > }
> > - } else {
> > - ret = omap_usbhs_alloc_children(pdev);
> > - if (ret) {
> > - dev_err(dev, "omap_usbhs_alloc_children failed: %d\n",
> > - ret);
> > - goto err_mem;
> > - }
> > }
> >
> > return 0;
[snip]
next reply other threads:[~2018-09-12 8:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 8:30 Laurent Pinchart [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-09-12 8:49 [3/3] mfd: omap-usb-host: Drop support for non-DT probe Roger Quadros
2018-09-12 7:57 Roger Quadros
2018-09-11 15:06 Laurent Pinchart
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=3845315.THatgfdZ0C@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=lee.jones@linaro.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rogerq@ti.com \
--cc=tomi.valkeinen@ti.com \
--cc=tony@atomide.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).