Re: [PATCH 1/6] mmc: host: omap_hsmmc: trivial cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 15, 2012 at 7:30 PM, Felipe Balbi <balbi@xxxxxx> wrote:
> Hi,
>
> On Thu, Mar 15, 2012 at 07:20:22PM +0530, T Krishnamoorthy, Balaji wrote:
>> On Wed, Mar 14, 2012 at 2:48 PM, Felipe Balbi <balbi@xxxxxx> wrote:
>> > a bunch of non-functional cleanups to the omap_hsmmc
>> > driver.
>> >
>> > It basically decreases indentation level, drop unneded
>> > dereferences and drop unneded accesses to the platform_device
>> > structure.
>> >
>> > Signed-off-by: Felipe Balbi <balbi@xxxxxx>
>> > ---
>> >  drivers/mmc/host/omap_hsmmc.c |  147 ++++++++++++++++++++---------------------
>> >  1 file changed, 70 insertions(+), 77 deletions(-)
>> >
>> > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
>> > index fd0c661..11fef49 100644
>> > --- a/drivers/mmc/host/omap_hsmmc.c
>> > +++ b/drivers/mmc/host/omap_hsmmc.c
>> > @@ -2104,30 +2104,28 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
>> >        struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
>> >        struct resource *res;
>> >
>> > -       if (host) {
>> > -               pm_runtime_get_sync(host->dev);
>> > -               mmc_remove_host(host->mmc);
>> > -               if (host->use_reg)
>> > -                       omap_hsmmc_reg_put(host);
>> > -               if (host->pdata->cleanup)
>> > -                       host->pdata->cleanup(&pdev->dev);
>> > -               free_irq(host->irq, host);
>> > -               if (mmc_slot(host).card_detect_irq)
>> > -                       free_irq(mmc_slot(host).card_detect_irq, host);
>> > -
>> > -               pm_runtime_put_sync(host->dev);
>> > -               pm_runtime_disable(host->dev);
>> > -               clk_put(host->fclk);
>> > -               if (host->got_dbclk) {
>> > -                       clk_disable(host->dbclk);
>> > -                       clk_put(host->dbclk);
>> > -               }
>> Hi,
>>
>> Checking for host NULL is added in suspend/resume, however it is missing in
>> .remove, is it intentional ?
>
> you mean:
>
> if (!host)
>        return 0;
>
> ???
>
> That's intentional. We know platform_set_drvdata() is called on probe,
> and we can only reach .remove if .probe was called first. So we can make
> the assumption that dev->p->driver_data will always be valid on .remove.
> If it isn't, it's a bug on driver core which we want to catch ASAP, so
> it deserves to oops.
>

Agreed.

> --
> balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux