[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e335e5c7-bf7e-22d8-4dbf-15b0477d8d5d@cmss.chinamobile.com>
Date: Fri, 8 May 2020 22:28:25 +0800
From: Tang Bin <tangbin@...s.chinamobile.com>
To: Alan Stern <stern@...land.harvard.edu>
Cc: gregkh@...uxfoundation.org, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org,
Zhang Shengju <zhangshengju@...s.chinamobile.com>
Subject: Re: [PATCH] USB: host: ehci: Use the defined variable to simplifycode
On 2020/5/8 21:56, Alan Stern wrote:
> On Fri, 8 May 2020, Tang Bin wrote:
>
>> Use the defined variable "dev" to make the code cleaner. And
>> delete an extra blank line.
> Again, the Subject: line should say "ehci-mxc".
Got it.
>
>> Signed-off-by: Zhang Shengju <zhangshengju@...s.chinamobile.com>
>> Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
>> ---
>> drivers/usb/host/ehci-mxc.c | 9 ++++-----
>> 1 file changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
>> index c9f91e6c7..a1eb5ee77 100644
>> --- a/drivers/usb/host/ehci-mxc.c
>> +++ b/drivers/usb/host/ehci-mxc.c
>> @@ -56,7 +56,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
>> return -ENOMEM;
>>
>> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> - hcd->regs = devm_ioremap_resource(&pdev->dev, res);
>> + hcd->regs = devm_ioremap_resource(dev, res);
> As long as you're making these changes, why not also move the
> definition of dev up before the definition of pdata? Then you could
> change the definition of pdata to:
>
> struct mxc_usbh_platform_data *pdata = dev_get_platdata(dev);
>
Got it.
Thanks
Powered by blists - more mailing lists