Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp923216ybv; Thu, 20 Feb 2020 09:39:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzD2/mGBtoQOPu5tiOypHuRSymQdL+26fLma5EYl6UCHJo9BEguiia1zEuyvn+YKosQVjYC X-Received: by 2002:a9d:7ccc:: with SMTP id r12mr25576262otn.22.1582220361586; Thu, 20 Feb 2020 09:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582220361; cv=none; d=google.com; s=arc-20160816; b=M0eHmms7p6Ow7nYZseylGv0A/9gqtu1b6xdjGOcZzTf8Dx4zj6sNzEki4jk/GAjMtW VR2COprKQoWijnFdRWJcfUcufspHAg2ai70OpzTZrZdNkhQ8E4u9T/jszBKHQierTuu9 1pPtiiHWJf26a36nt6RN6lGwZrxsbyQFroOUDmJ39ZDX8y8xByMm+ukiV9ErcATiK2aQ UX8b+ysPF/yQuNFboZglNNKqAw4X6DCmwz2SUxN2O+jRV6zWvGgTRPHzsGHzf/2BzsgG TDaV9goRsS1TiDad+3RtYlLtXXGqwhfts3nOPEzT2ICXYRiBd3qdPcy2YxnpJJIYSKnf 4oow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=kJSXURi17GaZNBPP0JzcsPR2iR7Cn6Nw/QvOcKOXUPo=; b=ER92YXySl/gbCobssSJCDND5rvrNSpvdQYmKJfvdVXDJ9+2pHo9tRllHTHUQXiJVaj LXf56tH/wc1JjcLxPOOcQYYbkiZ3nlHSFFrGh1x9aQWhz1yRQ1jHIGswHNNmTGcUZZNC b5WzxwO4weWpGNLIjQ3aK2SZP/wjxCOGr+NRz96qQVcX5tVYO9JJ5zGevq3EQsDp0o0l VGjw+pSRuZHAdY1P42SEmdSvhVDmVNO6ta0yaGxjOnFu1fp2F0qsoTzqDMuN8G+NlW7b +7UeorWZigxVI88+Zg6dGXvgedQShQEhgFnbOOaNp3fa2unA/ORBziCuDh9lE9KO/ZA6 5OLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yxd42H7I; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 6si41774otv.224.2020.02.20.09.39.09; Thu, 20 Feb 2020 09:39:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yxd42H7I; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728871AbgBTRhi (ORCPT + 99 others); Thu, 20 Feb 2020 12:37:38 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46742 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728356AbgBTRhh (ORCPT ); Thu, 20 Feb 2020 12:37:37 -0500 Received: by mail-pf1-f196.google.com with SMTP id k29so2236369pfp.13; Thu, 20 Feb 2020 09:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=kJSXURi17GaZNBPP0JzcsPR2iR7Cn6Nw/QvOcKOXUPo=; b=Yxd42H7IRMldkJRd27VpBEePGf27gJnokv+p3ly2v/y5c0C1Z6jbZSQuQ2QR5z2rIO 9SOwkfzqGaYOv8MQExVergqESF5GA/Gx9AddqnWQ1zDLP0UavTKBlbsWHiIDZZWDh6ly SkSI9FZGoc8ZsXfSjyw1orpOHfeJEgiHAEnyOsQHzY4TkPIXY+JWCtuERlQgLIgwA80D GHbDnEG3ZdWwWJ9/Ilup32w4KiVjhhK1iOBfGBnRpUpe1X0cdWBBzLBrOXQUT3rJ04s+ 77lqXgFXuPWI1G3FOj16n15kQDqSdoUyWltrzhFH/SIXlxD7P3/Aml8/jaC7Od0gZ1v+ 6eJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kJSXURi17GaZNBPP0JzcsPR2iR7Cn6Nw/QvOcKOXUPo=; b=iUFlRR+Qr6E+Dhmoxj6EixPWbreBnPZhZFYlx7nuMmhPqydTSPLS9VxAzEclWYtMq/ df5s49r7cjzZ+en43PEnwSTXznsjym6B9KCmP3hD5fhHfub0EQ+LreEBN9ciC/oNv5AL WPlVkuVIsMA20lrkOI1vvMdI0DM9vc29pj9SsJRGWsLtz6aLi9nef1QQjaqBacJc682c 9/l6m7KgoxVGuplGDH3TOd64s4cB3ZszWkhj8HTKRYzexVjVPRZwY44jvEIqZ9dSecCG sIKM5RxNh9BSnKeAT/UwJFdBZ2h2UV8Wpw3FgM6x9VrqT6kz1vz7/96HFp9yEYQAdkLS cncQ== X-Gm-Message-State: APjAAAXdG3f1FpWkG1qFUQsEvfNzsixJ/NsV06jQXQt9eTfhCjhgKg7d e2hf79jwo6c7PQpHT/U/rDc= X-Received: by 2002:a63:be48:: with SMTP id g8mr35351706pgo.23.1582220256810; Thu, 20 Feb 2020 09:37:36 -0800 (PST) Received: from lenovo.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id m18sm4240960pgd.39.2020.02.20.09.37.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Feb 2020 09:37:35 -0800 (PST) From: Orson Zhai To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi Cc: Greg Kroah-Hartman , John Stultz , mingmin.ling@unisoc.com, orsonzhai@gmail.com, jingchao.ye@unisoc.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Orson Zhai Subject: [PATCH] Revert "PM / devfreq: Modify the device name as devfreq(X) for sysfs" Date: Fri, 21 Feb 2020 01:37:04 +0800 Message-Id: <1582220224-1904-1-git-send-email-orson.unisoc@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 4585fbcb5331fc910b7e553ad3efd0dd7b320d14. The name changing as devfreq(X) breaks some user space applications, such as Android HAL from Unisoc and Hikey [1]. The device name will be changed unexpectly after every boot depending on module init sequence. It will make trouble to setup some system configuration like selinux for Android. So we'd like to revert it back to old naming rule before any better way being found. [1] https://lkml.org/lkml/2018/5/8/1042 Cc: John Stultz Cc: Greg Kroah-Hartman Cc: stable@vger.kernel.org Signed-off-by: Orson Zhai --- drivers/devfreq/devfreq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index cceee8b..7dcf209 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -738,7 +738,6 @@ struct devfreq *devfreq_add_device(struct device *dev, { struct devfreq *devfreq; struct devfreq_governor *governor; - static atomic_t devfreq_no = ATOMIC_INIT(-1); int err = 0; if (!dev || !profile || !governor_name) { @@ -800,8 +799,7 @@ struct devfreq *devfreq_add_device(struct device *dev, devfreq->suspend_freq = dev_pm_opp_get_suspend_opp_freq(dev); atomic_set(&devfreq->suspend_count, 0); - dev_set_name(&devfreq->dev, "devfreq%d", - atomic_inc_return(&devfreq_no)); + dev_set_name(&devfreq->dev, "%s", dev_name(dev)); err = device_register(&devfreq->dev); if (err) { mutex_unlock(&devfreq->lock); -- 2.7.4