From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751531AbdARG5L (ORCPT ); Wed, 18 Jan 2017 01:57:11 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:33016 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751268AbdARG5I (ORCPT ); Wed, 18 Jan 2017 01:57:08 -0500 X-AuditID: b6c32a2d-f79166d000001fef-1d-587f11b5d2aa From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, rjw@rjwysocki.net Cc: cw00.choi@samsung.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] PM / devfreq: Remove unnecessary separate _remove_devfreq() Date: Wed, 18 Jan 2017 15:56:51 +0900 Message-id: <1484722611-10555-4-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1484722611-10555-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPKsWRmVeSWpSXmKPExsWy7bCmlu5WwfoIg6uvjC2uf3nOanG26Q27 xeVdc9gsPvceYbS43biCzeLM6UusDmweW662s3j0bVnF6PF5k1wAc1SqTUZqYkpqkUJqXnJ+ SmZeuq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7QXiWFssScUqBQQGJxsZK+nU1R fmlJqkJGfnGJrVK0oaGRnqGBuZ6RkZGeiXGslZEpUElCasas260sBUf5K/789Wlg/MbTxcjB ISFgInG716yLkRPIFJO4cG89G4gtJLCUUeL2SaASLiC7nUniy/EtbBBFJhLTD29lh0jMYZS4 unU9E4Tzg1Gi53IXC0gVm4CWxP4XN8A6RAS8JPYf+sIOYjMLBEt0bP7LDGILCwRJTHu/kQXk ChYBVYn3b8VBwrwCrhJzth5kglgmJ/FhzyOwVk4BN4nulj5GkF0SArfZJN6d/coM8YGsxKYD zBD1LhL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B8ZTXkm8oYm5ibmxgYW5paWJkZI4b+PsZ+FCAumJ JanZqakFqUUwfUwcnFINjKuWcvLYGBzc8WCrneRprY2W+56fl+W4rVPpscwke9npI3L3mrPV r56KvjV37us/qi+dznszHP/T1yjx+YnUm57pop79htpyqbq2012VOPzDHltdvrDMtOc3s+Ti z5kfbFbtuv/xu9u09X1z+VdWVs9KNRQrt+zzSfSRyT7psL/UTZD7rODcTCWW4oxEQy3mouJE AHY57tFvAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170118065653epcas5p25728109e3bc2458dc16c23904f908c66 X-Msg-Generator: CA X-Sender-IP: 203.254.230.27 X-Local-Sender: =?UTF-8?B?7LWc7LCs7JqwG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbUzUo7LGF7J6EKS9DaGFuZ2UgQWdlbnQ=?= X-Global-Sender: =?UTF-8?B?Q2hhbndvbyBDaG9pG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtTNS9TZW5pb3IgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1NUQUYbQzEwVjgxMTE=?= CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-HopCount: 7 X-CMS-RootMailID: 20170118065653epcas5p25728109e3bc2458dc16c23904f908c66 X-RootMTR: 20170118065653epcas5p25728109e3bc2458dc16c23904f908c66 References: <1484722611-10555-1-git-send-email-cw00.choi@samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The _remove_devfreq() releases the all resources of the devfreq device. This function is only called in the devfreq_dev_release(). For that reason, the devfreq core doesn't need to leave the _remove_devfreq() separately. This patch releases the all resources in the devfreq_dev_release() and then removes the _remove_devfreq(). Signed-off-by: Chanwoo Choi --- drivers/devfreq/devfreq.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 6c560af2a801..c908c10c200a 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -480,11 +480,15 @@ static int devfreq_notifier_call(struct notifier_block *nb, unsigned long type, } /** - * _remove_devfreq() - Remove devfreq from the list and release its resources. - * @devfreq: the devfreq struct + * devfreq_dev_release() - Callback for struct device to release the device. + * @dev: the devfreq device + * + * Remove devfreq from the list and release its resources. */ -static void _remove_devfreq(struct devfreq *devfreq) +static void devfreq_dev_release(struct device *dev) { + struct devfreq *devfreq = to_devfreq(dev); + mutex_lock(&devfreq_list_lock); if (IS_ERR(find_device_devfreq(devfreq->dev.parent))) { mutex_unlock(&devfreq_list_lock); @@ -506,19 +510,6 @@ static void _remove_devfreq(struct devfreq *devfreq) } /** - * devfreq_dev_release() - Callback for struct device to release the device. - * @dev: the devfreq device - * - * This calls _remove_devfreq() if _remove_devfreq() is not called. - */ -static void devfreq_dev_release(struct device *dev) -{ - struct devfreq *devfreq = to_devfreq(dev); - - _remove_devfreq(devfreq); -} - -/** * devfreq_add_device() - Add devfreq feature to the device * @dev: the device to add devfreq feature. * @profile: device-specific profile to run devfreq. -- 1.9.1