On 12/09/18 11:30, Laurent Pinchart wrote:
> 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.pinch...@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).

Ah, you're right.
Seems like it uses it only to get the nports, and port_mode[].

For this patch.

Acked-by: Roger Quadros <rog...@ti.com>

> 
>>>     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]
> 

cheers,
-roger

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Reply via email to