Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc: c2port: use kobj_to_dev()

Use kobj_to_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Geliang Tang and committed by
Greg Kroah-Hartman
47679cde 85016ff3

+2 -6
+2 -6
drivers/misc/c2port/core.c
··· 721 721 struct bin_attribute *attr, 722 722 char *buffer, loff_t offset, size_t count) 723 723 { 724 - struct c2port_device *c2dev = 725 - dev_get_drvdata(container_of(kobj, 726 - struct device, kobj)); 724 + struct c2port_device *c2dev = dev_get_drvdata(kobj_to_dev(kobj)); 727 725 ssize_t ret; 728 726 729 727 /* Check the device and flash access status */ ··· 836 838 struct bin_attribute *attr, 837 839 char *buffer, loff_t offset, size_t count) 838 840 { 839 - struct c2port_device *c2dev = 840 - dev_get_drvdata(container_of(kobj, 841 - struct device, kobj)); 841 + struct c2port_device *c2dev = dev_get_drvdata(kobj_to_dev(kobj)); 842 842 int ret; 843 843 844 844 /* Check the device access status */