File tree 1 file changed +15
-1
lines changed 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -174,12 +174,26 @@ static void hid_test_uclogic_parse_ugee_v2_desc(struct kunit *test)
174
174
KUNIT_EXPECT_EQ (test , params -> frame_type , frame_type );
175
175
}
176
176
177
+ struct fake_device {
178
+ unsigned long quirks ;
179
+ };
180
+
177
181
static void hid_test_uclogic_params_cleanup_event_hooks (struct kunit * test )
178
182
{
179
183
int res , n ;
184
+ struct hid_device * hdev ;
185
+ struct fake_device * fake_dev ;
180
186
struct uclogic_params p = {0 , };
181
187
182
- res = uclogic_params_ugee_v2_init_event_hooks (NULL , & p );
188
+ hdev = kunit_kzalloc (test , sizeof (struct hid_device ), GFP_KERNEL );
189
+ KUNIT_ASSERT_NOT_ERR_OR_NULL (test , hdev );
190
+
191
+ fake_dev = kunit_kzalloc (test , sizeof (struct fake_device ), GFP_KERNEL );
192
+ KUNIT_ASSERT_NOT_ERR_OR_NULL (test , fake_dev );
193
+
194
+ hid_set_drvdata (hdev , fake_dev );
195
+
196
+ res = uclogic_params_ugee_v2_init_event_hooks (hdev , & p );
183
197
KUNIT_ASSERT_EQ (test , res , 0 );
184
198
185
199
/* Check that the function can be called repeatedly */
You can’t perform that action at this time.
0 commit comments