platform/x86: Simplify getting .drvdata
We should get drvdata 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: Darren Hart (VMware) <dvhart@infradead.org>
This commit is contained in:
parent
06b8b00b33
commit
d605ca29c3
|
@ -1593,8 +1593,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
|
|||
int idx)
|
||||
{
|
||||
struct device *dev = container_of(kobj, struct device, kobj);
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct asus_laptop *asus = platform_get_drvdata(pdev);
|
||||
struct asus_laptop *asus = dev_get_drvdata(dev);
|
||||
acpi_handle handle = asus->handle;
|
||||
bool supported;
|
||||
|
||||
|
|
|
@ -1862,8 +1862,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
|
|||
struct attribute *attr, int idx)
|
||||
{
|
||||
struct device *dev = container_of(kobj, struct device, kobj);
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct asus_wmi *asus = platform_get_drvdata(pdev);
|
||||
struct asus_wmi *asus = dev_get_drvdata(dev);
|
||||
bool ok = true;
|
||||
int devid = -1;
|
||||
|
||||
|
|
|
@ -1216,8 +1216,7 @@ static umode_t samsung_sysfs_is_visible(struct kobject *kobj,
|
|||
struct attribute *attr, int idx)
|
||||
{
|
||||
struct device *dev = container_of(kobj, struct device, kobj);
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct samsung_laptop *samsung = platform_get_drvdata(pdev);
|
||||
struct samsung_laptop *samsung = dev_get_drvdata(dev);
|
||||
bool ok = true;
|
||||
|
||||
if (attr == &dev_attr_performance_level.attr)
|
||||
|
|
Loading…
Reference in New Issue