lkml.org 
[lkml]   [2017]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/6] mmc: tmio: set tmio_mmc_host to driver data
On Tue, Nov 07, 2017 at 05:09:28PM +0900, Masahiro Yamada wrote:
> The remove, suspend, resume hooks need tmio_mmc_host. It is tedious
> to get mmc_host from the driver_data and pass it to mmc_priv().
> We can directly set tmio_mmc_host to driver data to clean up the code.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

...

> diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
> index 64b7e9f..ccfbc15 100644
> --- a/drivers/mmc/host/tmio_mmc.c
> +++ b/drivers/mmc/host/tmio_mmc.c
> @@ -128,15 +128,11 @@ static int tmio_mmc_probe(struct platform_device *pdev)
> static int tmio_mmc_remove(struct platform_device *pdev)
> {
> const struct mfd_cell *cell = mfd_get_cell(pdev);
> - struct mmc_host *mmc = platform_get_drvdata(pdev);
> + struct tmio_mmc_host *host = platform_get_drvdata(pdev);
>
> - if (mmc) {
> - struct tmio_mmc_host *host = mmc_priv(mmc);
> -
> - tmio_mmc_host_remove(host);
> - if (cell->disable)
> - cell->disable(pdev);
> - }
> + tmio_mmc_host_remove(host);
> + if (cell->disable)
> + cell->disable(pdev);

Hmmm, this changes the code logic. Any reason this driver checks for a
valid 'mmc' and can we safely drop it?

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-11-19 20:50    [W:0.078 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site