bus: brcmstb_gisb: simplify getting .driver_data

We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
This commit is contained in:
Wolfram Sang 2018-10-21 21:59:58 +02:00 committed by Florian Fainelli
parent fb14ada11d
commit 0810d5cc29

View File

@ -150,8 +150,7 @@ static ssize_t gisb_arb_get_timeout(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct platform_device *pdev = to_platform_device(dev); struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev);
struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev);
u32 timeout; u32 timeout;
mutex_lock(&gdev->lock); mutex_lock(&gdev->lock);
@ -165,8 +164,7 @@ static ssize_t gisb_arb_set_timeout(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
struct platform_device *pdev = to_platform_device(dev); struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev);
struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev);
int val, ret; int val, ret;
ret = kstrtoint(buf, 10, &val); ret = kstrtoint(buf, 10, &val);
@ -418,8 +416,7 @@ static int __init brcmstb_gisb_arb_probe(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int brcmstb_gisb_arb_suspend(struct device *dev) static int brcmstb_gisb_arb_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev);
struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev);
gdev->saved_timeout = gisb_read(gdev, ARB_TIMER); gdev->saved_timeout = gisb_read(gdev, ARB_TIMER);
@ -431,8 +428,7 @@ static int brcmstb_gisb_arb_suspend(struct device *dev)
*/ */
static int brcmstb_gisb_arb_resume_noirq(struct device *dev) static int brcmstb_gisb_arb_resume_noirq(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev);
struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev);
gisb_write(gdev, gdev->saved_timeout, ARB_TIMER); gisb_write(gdev, gdev->saved_timeout, ARB_TIMER);