From: Viresh Kumar <viresh.kumar@linaro.org>
To: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Cc: hvaibhav.linux@gmail.com, johan@kernel.org, elder@kernel.org,
gregkh@linuxfoundation.org, greybus-dev@lists.linaro.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [greybus-dev] [PATCH] staging: greybus: Remove unnecessary platform_set_drvdata
Date: Thu, 27 Jul 2017 10:39:02 +0530 [thread overview]
Message-ID: <20170727050902.GI352@vireshk-i7> (raw)
In-Reply-To: <20170727031907.GA5605@amitoj-Inspiron-3542>
On 26-07-17, 23:19, Amitoj Kaur Chawla wrote:
> Unnecessary platform_set_drvdata() has been removed since the driver
> core clears the driver data to NULL after device release or on
> probe failure. There is no need to manually clear the device
> driver data to NULL.
>
> The Coccinelle semantic patch used to make this change is as follows:
> //<smpl>
> @@
> struct platform_device *pdev;
> @@
> - platform_set_drvdata(pdev, NULL);
> //</smpl>
>
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
> drivers/staging/greybus/arche-platform.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
> index eced2d2..358b260 100644
> --- a/drivers/staging/greybus/arche-platform.c
> +++ b/drivers/staging/greybus/arche-platform.c
> @@ -607,7 +607,6 @@ static int arche_platform_remove(struct platform_device *pdev)
> device_remove_file(&pdev->dev, &dev_attr_state);
> device_for_each_child(&pdev->dev, NULL, arche_remove_child);
> arche_platform_poweroff_seq(arche_pdata);
> - platform_set_drvdata(pdev, NULL);
>
> if (usb3613_hub_mode_ctrl(false))
> dev_warn(arche_pdata->dev, "failed to control hub device\n");
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
prev parent reply other threads:[~2017-07-27 5:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-27 3:19 Amitoj Kaur Chawla
2017-07-27 5:09 ` Viresh Kumar [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=20170727050902.GI352@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=amitoj1606@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=hvaibhav.linux@gmail.com \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®