diff options
author | Kefeng Wang <wangkefeng.wang@huawei.com> | 2019-05-09 16:23:39 +0200 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2019-05-14 09:13:28 +0200 |
commit | ed835136ee679dc528333c454ca4d1543c5aab76 (patch) | |
tree | a56bad55fdb4e66815cf036bbdfb0fb670c4a3b0 /drivers/mfd/t7l66xb.c | |
parent | mfd: cros_ec: Instantiate properly CrOS Touchpad MCU device (diff) | |
download | linux-ed835136ee679dc528333c454ca4d1543c5aab76.tar.xz linux-ed835136ee679dc528333c454ca4d1543c5aab76.zip |
mfd: Use dev_get_drvdata() directly
Using dev_get_drvdata directly.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/t7l66xb.c')
-rw-r--r-- | drivers/mfd/t7l66xb.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c index 43d8683266de..e9cfb147345e 100644 --- a/drivers/mfd/t7l66xb.c +++ b/drivers/mfd/t7l66xb.c @@ -82,8 +82,7 @@ struct t7l66xb { static int t7l66xb_mmc_enable(struct platform_device *mmc) { - struct platform_device *dev = to_platform_device(mmc->dev.parent); - struct t7l66xb *t7l66xb = platform_get_drvdata(dev); + struct t7l66xb *t7l66xb = dev_get_drvdata(mmc->dev.parent); unsigned long flags; u8 dev_ctl; int ret; @@ -108,8 +107,7 @@ static int t7l66xb_mmc_enable(struct platform_device *mmc) static int t7l66xb_mmc_disable(struct platform_device *mmc) { - struct platform_device *dev = to_platform_device(mmc->dev.parent); - struct t7l66xb *t7l66xb = platform_get_drvdata(dev); + struct t7l66xb *t7l66xb = dev_get_drvdata(mmc->dev.parent); unsigned long flags; u8 dev_ctl; @@ -128,16 +126,14 @@ static int t7l66xb_mmc_disable(struct platform_device *mmc) static void t7l66xb_mmc_pwr(struct platform_device *mmc, int state) { - struct platform_device *dev = to_platform_device(mmc->dev.parent); - struct t7l66xb *t7l66xb = platform_get_drvdata(dev); + struct t7l66xb *t7l66xb = dev_get_drvdata(mmc->dev.parent); tmio_core_mmc_pwr(t7l66xb->scr + 0x200, 0, state); } static void t7l66xb_mmc_clk_div(struct platform_device *mmc, int state) { - struct platform_device *dev = to_platform_device(mmc->dev.parent); - struct t7l66xb *t7l66xb = platform_get_drvdata(dev); + struct t7l66xb *t7l66xb = dev_get_drvdata(mmc->dev.parent); tmio_core_mmc_clk_div(t7l66xb->scr + 0x200, 0, state); } |