@@ -87,8 +87,7 @@ static int inspur_wmi_perform_query(struct wmi_device *wdev,
87
87
static int inspur_platform_profile_set (struct platform_profile_handler * pprof ,
88
88
enum platform_profile_option profile )
89
89
{
90
- struct inspur_wmi_priv * priv = container_of (pprof , struct inspur_wmi_priv ,
91
- handler );
90
+ struct inspur_wmi_priv * priv = dev_get_drvdata (& pprof -> class_dev );
92
91
u8 ret_code [4 ] = {0 , 0 , 0 , 0 };
93
92
int ret ;
94
93
@@ -135,8 +134,7 @@ static int inspur_platform_profile_set(struct platform_profile_handler *pprof,
135
134
static int inspur_platform_profile_get (struct platform_profile_handler * pprof ,
136
135
enum platform_profile_option * profile )
137
136
{
138
- struct inspur_wmi_priv * priv = container_of (pprof , struct inspur_wmi_priv ,
139
- handler );
137
+ struct inspur_wmi_priv * priv = dev_get_drvdata (& pprof -> class_dev );
140
138
u8 ret_code [4 ] = {0 , 0 , 0 , 0 };
141
139
int ret ;
142
140
@@ -186,7 +184,7 @@ static int inspur_wmi_probe(struct wmi_device *wdev, const void *context)
186
184
set_bit (PLATFORM_PROFILE_BALANCED , priv -> handler .choices );
187
185
set_bit (PLATFORM_PROFILE_PERFORMANCE , priv -> handler .choices );
188
186
189
- return platform_profile_register (& priv -> handler );
187
+ return platform_profile_register (& priv -> handler , priv );
190
188
}
191
189
192
190
static void inspur_wmi_remove (struct wmi_device * wdev )
0 commit comments