Re: [PATCH v2] Input: omap-keypad: Fix error goto and handling in omap4_keypad_probe

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

 



Hi,

On Fri, Nov 20, 2020 at 09:39:18PM +0800, Zhang Qilong wrote:
> @@ -269,41 +298,32 @@ static int omap4_keypad_probe(struct platform_device *pdev)
>  		goto err_release_mem;
>  	}
>  
> +	pm_runtime_enable(&pdev->dev);
>  
>  	/*
>  	 * Enable clocks for the keypad module so that we can read
>  	 * revision register.
>  	 */
> -	pm_runtime_enable(&pdev->dev);
>  	error = pm_runtime_get_sync(&pdev->dev);
>  	if (error) {
> +		pm_runtime_put_noidle(&pdev->dev);
>  		dev_err(&pdev->dev, "pm_runtime_get_sync() failed\n");
> -		goto err_unmap;
> -	}
> -	rev = __raw_readl(keypad_data->base + OMAP4_KBD_REVISION);
> -	rev &= 0x03 << 30;
> -	rev >>= 30;
> -	switch (rev) {
> -	case KBD_REVISION_OMAP4:
> -		keypad_data->reg_offset = 0x00;
> -		keypad_data->irqreg_offset = 0x00;
> -		break;
> -	case KBD_REVISION_OMAP5:
> -		keypad_data->reg_offset = 0x10;
> -		keypad_data->irqreg_offset = 0x0c;
> -		break;
> -	default:
> -		dev_err(&pdev->dev,
> -			"Keypad reports unsupported revision %d", rev);
> -		error = -EINVAL;
> -		goto err_pm_put_sync;
> +		goto err_pm_disable;
> +	} else {
> +		error = omap4_keypad_check_revision(&pdev->dev,
> +						    keypad_data);
> +		if (!error) {
> +			/* Ensure device does not raise interrupts */
> +			omap4_keypad_stop(keypad_data);
> +		}
> +		pm_runtime_put_sync(&pdev->dev);
>  	}
>  

So here there I mean to have

	if (error)
		goto err_pm_disable;

I added it (and removed "goto" from the branch above) and applied, thank
you.

-- 
Dmitry




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux