linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"dmitry.torokhov@gmail.com" <dmitry.torokhov@gmail.com>,
	"patches@linaro.org" <patches@linaro.org>,
	Joonyoung Shim <jy0922.shim@samsung.com>
Subject: Re: [PATCH Resend] Input: mms114: Use devm_* APIs
Date: Wed, 9 Jan 2013 10:38:31 +0530	[thread overview]
Message-ID: <50ECFB4F.8010501@nvidia.com> (raw)
In-Reply-To: <1357704948-25758-1-git-send-email-sachin.kamat@linaro.org>

On Wednesday 09 January 2013 09:45 AM, Sachin Kamat wrote:
> devm_* APIs are device managed and make the exit and clean up code
> simpler.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Joonyoung Shim <jy0922.shim@samsung.com>
> ---

I think this is not resend patch, it is Patch V2. Also you can specify 
the changes done from last patch to this patch so that it will be easy 
to reviewer.

> +	data = devm_kzalloc(&client->dev, sizeof(struct mms114_data),
Because you are here, better to change the size to sizeof(*data) in 
place of sizeof(struct..)

> +			

> +	error = devm_request_threaded_irq(&client->dev, client->irq, NULL,
> +			mms114_interrupt, IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> +			"mms114", data);

Should be change to devname(&client->dev) in place of hardconding to 
"mms114".

>   	if (error) {
>   		dev_err(&client->dev, "Failed to register interrupt\n");
> -		goto err_io_reg;
> +		return error;
>   	}
>   	disable_irq(client->irq);
>   
>   	error = input_register_device(data->input_dev);
>   	if (error)

> -		
> +		return error;
>   
>   	return 0;


Seems the code turn as
if (error)
    return error;
return 0.

I think simply saying return error is fine here as you are not printing 
any error.
>   }
> @@ -590,7 +567,6 @@ static struct i2c_driver mms114_driver = {
>   		.of_match_table = of_match_ptr(mms114_dt_match),
>   	},
>   	.probe		= mms114_probe,
> -	.remove		= mms114_remove,
>   	.id_table	= mms114_id,
>   };
>   


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

  reply	other threads:[~2013-01-09  5:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-09  4:15 [PATCH Resend] Input: mms114: Use devm_* APIs Sachin Kamat
2013-01-09  5:08 ` Laxman Dewangan [this message]
2013-01-09  6:57   ` Sachin Kamat

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=50ECFB4F.8010501@nvidia.com \
    --to=ldewangan@nvidia.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jy0922.shim@samsung.com \
    --cc=linux-input@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=sachin.kamat@linaro.org \
    /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).