@@ -679,7 +679,7 @@ static struct attribute *nct7802_temp_attrs[] = {
679
679
static umode_t nct7802_temp_is_visible (struct kobject * kobj ,
680
680
struct attribute * attr , int index )
681
681
{
682
- struct device * dev = container_of ( kobj , struct device , kobj );
682
+ struct device * dev = kobj_to_dev ( kobj );
683
683
struct nct7802_data * data = dev_get_drvdata (dev );
684
684
unsigned int reg ;
685
685
int err ;
@@ -778,7 +778,7 @@ static struct attribute *nct7802_in_attrs[] = {
778
778
static umode_t nct7802_in_is_visible (struct kobject * kobj ,
779
779
struct attribute * attr , int index )
780
780
{
781
- struct device * dev = container_of ( kobj , struct device , kobj );
781
+ struct device * dev = kobj_to_dev ( kobj );
782
782
struct nct7802_data * data = dev_get_drvdata (dev );
783
783
unsigned int reg ;
784
784
int err ;
@@ -853,7 +853,7 @@ static struct attribute *nct7802_fan_attrs[] = {
853
853
static umode_t nct7802_fan_is_visible (struct kobject * kobj ,
854
854
struct attribute * attr , int index )
855
855
{
856
- struct device * dev = container_of ( kobj , struct device , kobj );
856
+ struct device * dev = kobj_to_dev ( kobj );
857
857
struct nct7802_data * data = dev_get_drvdata (dev );
858
858
int fan = index / 4 ; /* 4 attributes per fan */
859
859
unsigned int reg ;
0 commit comments