linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Zhang Qilong <zhangqilong3@huawei.com>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH v2] Input: omap-keypad: Fix error goto and handling in omap4_keypad_probe
Date: Sun, 22 Nov 2020 22:46:46 -0800	[thread overview]
Message-ID: <20201123064646.GY2034289@dtor-ws> (raw)
In-Reply-To: <20201120133918.2559681-1-zhangqilong3@huawei.com>

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

      reply	other threads:[~2020-11-23  6:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 13:39 [PATCH v2] Input: omap-keypad: Fix error goto and handling in omap4_keypad_probe Zhang Qilong
2020-11-23  6:46 ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201123064646.GY2034289@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=zhangqilong3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).