Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751574AbdG0FJI (ORCPT ); Thu, 27 Jul 2017 01:09:08 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:34952 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbdG0FJG (ORCPT ); Thu, 27 Jul 2017 01:09:06 -0400 Date: Thu, 27 Jul 2017 10:39:02 +0530 From: Viresh Kumar To: Amitoj Kaur Chawla 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 Message-ID: <20170727050902.GI352@vireshk-i7> References: <20170727031907.GA5605@amitoj-Inspiron-3542> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170727031907.GA5605@amitoj-Inspiron-3542> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1287 Lines: 36 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: > // > @@ > struct platform_device *pdev; > @@ > - platform_set_drvdata(pdev, NULL); > // > > Signed-off-by: Amitoj Kaur Chawla > --- > 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