Skip to content

Commit fed5003

Browse files
jwrdegoedeandy-shev
authored andcommitted
platform/x86: asus-wmi: Move asus_wmi_input_init and _exit lower in the file
Move the asus_wmi_input_init() and asus_wmi_input_exit() functions to below the WMI helpers, so that further patches in this patch-set can use the WMI helpers inside asus_wmi_input_init() without needing a forward declaration. Note this commit makes no functional changes, the moved block of code is completely unchanged. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 6568d0c commit fed5003

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

drivers/platform/x86/asus-wmi.c

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -222,45 +222,6 @@ struct asus_wmi {
222222
struct asus_wmi_driver *driver;
223223
};
224224

225-
/* Input **********************************************************************/
226-
227-
static int asus_wmi_input_init(struct asus_wmi *asus)
228-
{
229-
int err;
230-
231-
asus->inputdev = input_allocate_device();
232-
if (!asus->inputdev)
233-
return -ENOMEM;
234-
235-
asus->inputdev->name = asus->driver->input_name;
236-
asus->inputdev->phys = asus->driver->input_phys;
237-
asus->inputdev->id.bustype = BUS_HOST;
238-
asus->inputdev->dev.parent = &asus->platform_device->dev;
239-
set_bit(EV_REP, asus->inputdev->evbit);
240-
241-
err = sparse_keymap_setup(asus->inputdev, asus->driver->keymap, NULL);
242-
if (err)
243-
goto err_free_dev;
244-
245-
err = input_register_device(asus->inputdev);
246-
if (err)
247-
goto err_free_dev;
248-
249-
return 0;
250-
251-
err_free_dev:
252-
input_free_device(asus->inputdev);
253-
return err;
254-
}
255-
256-
static void asus_wmi_input_exit(struct asus_wmi *asus)
257-
{
258-
if (asus->inputdev)
259-
input_unregister_device(asus->inputdev);
260-
261-
asus->inputdev = NULL;
262-
}
263-
264225
/* WMI ************************************************************************/
265226

266227
static int asus_wmi_evaluate_method3(u32 method_id,
@@ -381,6 +342,45 @@ static bool asus_wmi_dev_is_present(struct asus_wmi *asus, u32 dev_id)
381342
return status == 0 && (retval & ASUS_WMI_DSTS_PRESENCE_BIT);
382343
}
383344

345+
/* Input **********************************************************************/
346+
347+
static int asus_wmi_input_init(struct asus_wmi *asus)
348+
{
349+
int err;
350+
351+
asus->inputdev = input_allocate_device();
352+
if (!asus->inputdev)
353+
return -ENOMEM;
354+
355+
asus->inputdev->name = asus->driver->input_name;
356+
asus->inputdev->phys = asus->driver->input_phys;
357+
asus->inputdev->id.bustype = BUS_HOST;
358+
asus->inputdev->dev.parent = &asus->platform_device->dev;
359+
set_bit(EV_REP, asus->inputdev->evbit);
360+
361+
err = sparse_keymap_setup(asus->inputdev, asus->driver->keymap, NULL);
362+
if (err)
363+
goto err_free_dev;
364+
365+
err = input_register_device(asus->inputdev);
366+
if (err)
367+
goto err_free_dev;
368+
369+
return 0;
370+
371+
err_free_dev:
372+
input_free_device(asus->inputdev);
373+
return err;
374+
}
375+
376+
static void asus_wmi_input_exit(struct asus_wmi *asus)
377+
{
378+
if (asus->inputdev)
379+
input_unregister_device(asus->inputdev);
380+
381+
asus->inputdev = NULL;
382+
}
383+
384384
/* Battery ********************************************************************/
385385

386386
/* The battery maximum charging percentage */

0 commit comments

Comments
 (0)