Re: [PATCH 4/4] Input: omap4-keypad - simplify probe with devm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tony,

On Wed, Jan 06, 2021 at 02:58:22PM +0200, Tony Lindgren wrote:
> Simplify probe with devm.

[...]

>  	/* input device allocation */
> -	keypad_data->input = input_dev = input_allocate_device();
> +	keypad_data->input = input_dev = devm_input_allocate_device(&pdev->dev);
>  	if (!input_dev) {
>  		error = -ENOMEM;
>  		goto err_pm_disable;

[...]

>  static int omap4_keypad_remove(struct platform_device *pdev)
>  {
>  	struct omap4_keypad *keypad_data = platform_get_drvdata(pdev);
> -	struct resource *res;
>  
>  	dev_pm_clear_wake_irq(&pdev->dev);
> -
> -	free_irq(keypad_data->irq, keypad_data);
> -
>  	pm_runtime_dont_use_autosuspend(&pdev->dev);
>  	pm_runtime_disable(&pdev->dev);
> -
>  	input_unregister_device(keypad_data->input);

not needed:

 * devm_input_allocate_device - allocate managed input device
 * @dev: device owning the input device being created
 *
 * Returns prepared struct input_dev or %NULL.
 *
 * Managed input devices do not need to be explicitly unregistered or
 * freed as it will be done automatically when owner device unbinds from
 * its driver (or binding fails). [...]

-- Sebastian

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux