From patchwork Wed Jun 2 11:43:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 12294005 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3F59C4708F for ; Wed, 2 Jun 2021 12:11:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9A910613B1 for ; Wed, 2 Jun 2021 12:11:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A910613B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j9er7HzXZCjYhQM/YsJd7eP5caOxRGp9wGVvDddnCKQ=; b=d1kehfyHo4A6xm 6LU9mtexNatXsvBAGdQYnnZl5lCPta0yCvZ/tTCLkQC1lqtp6gIANjE35d3knnecB9+zOa4nkd2Ct jHcz7/cWQZDGjNMPS/yDp6mHWwiFQyzvtHbVf12hDGB98VpuzQZdo8IRcuyT+d4vznzXj+KOQ1Z1E ZAdghnR9AliJDhEmPqJ/92nJtWF2WSwfw185BSLiWuqCPlfv1TTRy2O/sedLikLpQGHonXQGVM9Cz HfkGmm1e8yFf6Px9D91dBaPVIqdZROiEQZkWuOQybYeOd+mgVoaS7lE7l2A8q9MsctXKryQ6+XCaT T2EpF+8bdAGf5TiBjF2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPgJ-003uzm-Kf; Wed, 02 Jun 2021 12:09:08 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPI1-003o8O-GE for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 11:44:05 +0000 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Fw6YM0bcqzYnpR; Wed, 2 Jun 2021 19:41:11 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:55 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:55 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 1/9] mfd: wm831x: use DEVICE_ATTR_RO macro Date: Wed, 2 Jun 2021 19:43:31 +0800 Message-ID: <20210602114339.11223-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210602114339.11223-1-thunder.leizhen@huawei.com> References: <20210602114339.11223-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_044401_863099_B2F78B5C X-CRM114-Status: GOOD ( 10.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use DEVICE_ATTR_RO macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei Acked-by: Charles Keepax --- drivers/mfd/wm831x-otp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/wm831x-otp.c b/drivers/mfd/wm831x-otp.c index afe59d52dd74d55..25f5d9fe33a18e2 100644 --- a/drivers/mfd/wm831x-otp.c +++ b/drivers/mfd/wm831x-otp.c @@ -38,8 +38,8 @@ static int wm831x_unique_id_read(struct wm831x *wm831x, char *id) return 0; } -static ssize_t wm831x_unique_id_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t unique_id_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct wm831x *wm831x = dev_get_drvdata(dev); int rval; @@ -52,7 +52,7 @@ static ssize_t wm831x_unique_id_show(struct device *dev, return sprintf(buf, "%*phN\n", WM831X_UNIQUE_ID_LEN, id); } -static DEVICE_ATTR(unique_id, 0444, wm831x_unique_id_show, NULL); +static DEVICE_ATTR_RO(unique_id); int wm831x_otp_init(struct wm831x *wm831x) { From patchwork Wed Jun 2 11:43:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 12294023 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D93FEC4708F for ; Wed, 2 Jun 2021 12:12:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8DB9C61168 for ; Wed, 2 Jun 2021 12:12:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8DB9C61168 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LrJorKuWhB0hoTwDUtdbO/nRkMQXcWNELpi1ek3cCfU=; b=4rOsevsbgS15XH yztLbtKI2t1UwTXvT5MI8HZYo3DewHC1CYY3Izi8upJjoqvif/g7YE0UTC66Mv6nM9mxNtZuwImxL 0wpKkycRjmYPi2sEG0SIjuWqx+Qw6wq/7+DdjJy8xyCaPwhXBIMEGWwKkTCA0Rmd7HVeiiPNkOL1o 9Sn+2bcH0dXEk1uzJGElN5iCET6wS3djBaxpJLOm87+wshugazaieoAXxTiSXRTSk0c4C7VIOm8dk xAL/uRMZQc/lXq9bP5EewKl+GOuJ7xwbNCRMCtRrRdEN7fkqA4wypneAxdaKZpSMAnDtJM0I0HwE2 pEQ8B8WKbWzd0C/7iBgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPhO-003vK1-MD; Wed, 02 Jun 2021 12:10:16 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPI1-003o8N-Hm for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 11:44:05 +0000 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Fw6YM3wLLzYpXb; Wed, 2 Jun 2021 19:41:11 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:56 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:55 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 2/9] mfd: ucb1x00-assabet: use DEVICE_ATTR_RO macro Date: Wed, 2 Jun 2021 19:43:32 +0800 Message-ID: <20210602114339.11223-3-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210602114339.11223-1-thunder.leizhen@huawei.com> References: <20210602114339.11223-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_044401_993497_EACF2F1B X-CRM114-Status: GOOD ( 10.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use DEVICE_ATTR_RO macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/mfd/ucb1x00-assabet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/ucb1x00-assabet.c b/drivers/mfd/ucb1x00-assabet.c index ecc9e9fc331d6a3..6a389737c6153bc 100644 --- a/drivers/mfd/ucb1x00-assabet.c +++ b/drivers/mfd/ucb1x00-assabet.c @@ -28,7 +28,7 @@ static ssize_t name##_show(struct device *dev, struct device_attribute *attr, \ ucb1x00_adc_disable(ucb); \ return sprintf(buf, "%d\n", val); \ } \ -static DEVICE_ATTR(name,0444,name##_show,NULL) +static DEVICE_ATTR_RO(name) UCB1X00_ATTR(vbatt, UCB_ADC_INP_AD1); UCB1X00_ATTR(vcharger, UCB_ADC_INP_AD0); From patchwork Wed Jun 2 11:43:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 12294043 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15A5EC4708F for ; Wed, 2 Jun 2021 12:19:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA07260FDC for ; Wed, 2 Jun 2021 12:19:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA07260FDC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gZySmtfVcK++9scr1PwJOJTZgBuzVMXpbLnpPc6Ydw4=; b=gyixFQL+YcHsN3 G8dJ1EGsKG595RQou4UQvwdh/3mQ9VOIM0oeoHSYwhRGXI9zwnKBkyf6DZj9a4jkjg3GLSTuurCpy g/s/YF7Pq7YPbWpiLiOf06zF4cd/inVjMzIOdHdyEy+i5jDRVPDYJS16ibhxxYGUuGsMKY6HqwOKp SwvE1R6t4WAIuvr1mduXUg8bvGZsy4uoPBhnMZxnmYWjT8/jAwl3zh29tc5Ps0OlZO8aSXVFPs/0e 17o9jazqFcmYz1/v3jAI1Vr7nZH37OVKc8JbYVCdGZN/qibJgaFQfEJU4dYP9bjGVTYKb1DBnLN68 rJNyzXKt/8zU6DB/D+yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPoC-003yCo-Is; Wed, 02 Jun 2021 12:17:17 +0000 Received: from szxga03-in.huawei.com ([45.249.212.189]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPI2-003o8P-0z for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 11:44:06 +0000 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Fw6XD0M7gz67cN; Wed, 2 Jun 2021 19:40:12 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:56 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:56 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 3/9] mfd: timberdale: use DEVICE_ATTR_RO macro Date: Wed, 2 Jun 2021 19:43:33 +0800 Message-ID: <20210602114339.11223-4-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210602114339.11223-1-thunder.leizhen@huawei.com> References: <20210602114339.11223-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_044402_349157_D16D9640 X-CRM114-Status: GOOD ( 10.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use DEVICE_ATTR_RO macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/mfd/timberdale.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c index faecbca6dba3dc0..9393ee60a656cd4 100644 --- a/drivers/mfd/timberdale.c +++ b/drivers/mfd/timberdale.c @@ -623,8 +623,8 @@ static const struct mfd_cell timberdale_cells_bar2[] = { }, }; -static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr, - char *buf) +static ssize_t fw_ver_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct timberdale_device *priv = dev_get_drvdata(dev); @@ -632,7 +632,7 @@ static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr, priv->fw.config); } -static DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL); +static DEVICE_ATTR_RO(fw_ver); /*--------------------------------------------------------------------------*/ From patchwork Wed Jun 2 11:43:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 12294031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 924A9C4708F for ; Wed, 2 Jun 2021 12:16:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 64593613AD for ; Wed, 2 Jun 2021 12:16:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64593613AD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dHPCim0KKkvFybrmpXtlhfvV7EchSjX4PG44ikEwW50=; b=VA7K1VI9EJ953W 714NpBn375MDmaW0LBCaTHT+Jqrls98XL3SB8bcPDR+FZDAq+f0NG812CKwSTjnlUuo1wsEyo9Uir gsPBvUWgI5WmpiW9HpK1mvOx6MIrA8qclKwSyqhklYjSU1tiq3E8WDyjL0JHBZ+fVuQJ5d9n/o+PG 6QdfmurK5Z51dXbf0BtnEf4EaStswqdb9qmEu89ncnNe8+LEvRgRlb3JQAG27IV6t5flET7pgW6QG sW4rr6BWDT59ifXOW3X+mY6wE/1J8PS7M5SyTNaIU0zFQf50a7BKuInIrEU2zI9/DY8X3wZEkQL/4 dTTEQd8sl40ZAWkMHr+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPlf-003xHJ-FR; Wed, 02 Jun 2021 12:14:40 +0000 Received: from szxga08-in.huawei.com ([45.249.212.255]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPI2-003o8V-0d for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 11:44:06 +0000 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Fw6W60lwZz19S6K; Wed, 2 Jun 2021 19:39:14 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:56 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:56 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 4/9] mfd: sm501: use DEVICE_ATTR_RO macro Date: Wed, 2 Jun 2021 19:43:34 +0800 Message-ID: <20210602114339.11223-5-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210602114339.11223-1-thunder.leizhen@huawei.com> References: <20210602114339.11223-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_044402_296985_7DDB14A4 X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use DEVICE_ATTR_RO macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/mfd/sm501.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 6d2f4a0a901dc08..bc0a2c38653e51c 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c @@ -1190,13 +1190,13 @@ static int sm501_register_gpio_i2c(struct sm501_devdata *sm, return 0; } -/* sm501_dbg_regs +/* dbg_regs_show * * Debug attribute to attach to parent device to show core registers */ -static ssize_t sm501_dbg_regs(struct device *dev, - struct device_attribute *attr, char *buff) +static ssize_t dbg_regs_show(struct device *dev, + struct device_attribute *attr, char *buff) { struct sm501_devdata *sm = dev_get_drvdata(dev) ; unsigned int reg; @@ -1213,7 +1213,7 @@ static ssize_t sm501_dbg_regs(struct device *dev, } -static DEVICE_ATTR(dbg_regs, 0444, sm501_dbg_regs, NULL); +static DEVICE_ATTR_RO(dbg_regs); /* sm501_init_reg * From patchwork Wed Jun 2 11:43:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 12294027 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F41ADC47083 for ; Wed, 2 Jun 2021 12:14:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE616613AD for ; Wed, 2 Jun 2021 12:14:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE616613AD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4Tl0JWLujOmsHRMwUcmNSgS81X15TVcdt8xcvR3Iem0=; b=2BTw75C1KFqG9x xv5LQ7tslxADXubFRcUv+uMppcK06zK/sfwuF8KLhK1yiAUzZr8l1v4+0NRauQ6qOQHCl6goRloqg qB8yM9UwQZ2LRZZV5qoF4CbIRuqIdJSZ9IB1WXoc7w/R+QJQ/2zuIB5NUir3Fo/xK79z2XR0YJjGc oclAjoCfA0w+EgiZ/UQPdWzUYpgNoeKWUxqah3p2L/2MaMT/wDx0dhlopaAyIc7RxZn7tdu2WQG+6 QWkXUrAg4/TPNpp2G/j2xxxYN1Lmez+ElLDP6l6OuuLk24xyJZh0yMjLnjtAiw7fPdlsDgMMncAzS 3ggLgBK1mXyJ4AsWTLCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPjJ-003vwU-Jh; Wed, 02 Jun 2021 12:12:14 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPI1-003o8c-Kx for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 11:44:05 +0000 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Fw6Y73Bl5z68nS; Wed, 2 Jun 2021 19:40:59 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:57 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:56 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 5/9] mfd: pcf50633: use DEVICE_ATTR_ADMIN_RO macro Date: Wed, 2 Jun 2021 19:43:35 +0800 Message-ID: <20210602114339.11223-6-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210602114339.11223-1-thunder.leizhen@huawei.com> References: <20210602114339.11223-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_044402_022376_8208CCBF X-CRM114-Status: UNSURE ( 9.79 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use DEVICE_ATTR_ADMIN_RO macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/mfd/pcf50633-core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 148bcd6120f45a3..e9c565cf0f54f29 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c @@ -77,8 +77,8 @@ int pcf50633_reg_clear_bits(struct pcf50633 *pcf, u8 reg, u8 val) EXPORT_SYMBOL_GPL(pcf50633_reg_clear_bits); /* sysfs attributes */ -static ssize_t show_dump_regs(struct device *dev, struct device_attribute *attr, - char *buf) +static ssize_t dump_regs_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct pcf50633 *pcf = dev_get_drvdata(dev); u8 dump[16]; @@ -106,10 +106,10 @@ static ssize_t show_dump_regs(struct device *dev, struct device_attribute *attr, return buf1 - buf; } -static DEVICE_ATTR(dump_regs, 0400, show_dump_regs, NULL); +static DEVICE_ATTR_ADMIN_RO(dump_regs); -static ssize_t show_resume_reason(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t resume_reason_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct pcf50633 *pcf = dev_get_drvdata(dev); int n; @@ -123,7 +123,7 @@ static ssize_t show_resume_reason(struct device *dev, return n; } -static DEVICE_ATTR(resume_reason, 0400, show_resume_reason, NULL); +static DEVICE_ATTR_ADMIN_RO(resume_reason); static struct attribute *pcf_sysfs_entries[] = { &dev_attr_dump_regs.attr, From patchwork Wed Jun 2 11:43:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 12294029 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD5D1C4708F for ; Wed, 2 Jun 2021 12:15:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A8C6B613AD for ; Wed, 2 Jun 2021 12:15:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8C6B613AD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ed0VuT9GJOHOHpLMfZB1s2pnuMQsL+RrZSqsncamZZU=; b=4XNLvfxlaxaGwY i+enAferwlPA/lVRYHWBY+XAt6bFUAhxSV5aYIMa4GxFD+Df0SpDh7Sh1Zx7iTLGY7bdCtAHDBzCz aBEcPLXnT3n2J2Xk1qdjGL/rJnQbAlmS2LbBeFgHR/AS/fYILEse+DeAXDDlEmGkbmGsGx55J1DZ1 R491rPfj8wu7nzrCAfxmoTL3R23lP0ulqBB+MBlW2C0LcBAkh7qVuo72RunB9C/AuHkG7JWJ1UONA mRYr0hDCuiBZHcAFaCCso66k9ct8z6uXE0A0GxRcFtUVO6k0gmiNefIFQbdPievD1b9sHrfTuXTPa t0/zpGQ6YrGy59USoXDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPkQ-003wQE-7R; Wed, 02 Jun 2021 12:13:23 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPI1-003o99-I1 for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 11:44:06 +0000 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Fw6Y952hNz6933; Wed, 2 Jun 2021 19:41:01 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:57 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:57 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 6/9] mfd: kempld-core: use DEVICE_ATTR_RO macro Date: Wed, 2 Jun 2021 19:43:36 +0800 Message-ID: <20210602114339.11223-7-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210602114339.11223-1-thunder.leizhen@huawei.com> References: <20210602114339.11223-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_044401_995020_A22510CF X-CRM114-Status: UNSURE ( 8.67 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use DEVICE_ATTR_RO macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/mfd/kempld-core.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c index 9166075c1f321a4..bb26241c73bdb8f 100644 --- a/drivers/mfd/kempld-core.c +++ b/drivers/mfd/kempld-core.c @@ -344,16 +344,16 @@ static const char *kempld_get_type_string(struct kempld_device_data *pld) return version_type; } -static ssize_t kempld_version_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t pld_version_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct kempld_device_data *pld = dev_get_drvdata(dev); return scnprintf(buf, PAGE_SIZE, "%s\n", pld->info.version); } -static ssize_t kempld_specification_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t pld_specification_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct kempld_device_data *pld = dev_get_drvdata(dev); @@ -361,18 +361,17 @@ static ssize_t kempld_specification_show(struct device *dev, pld->info.spec_minor); } -static ssize_t kempld_type_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t pld_type_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct kempld_device_data *pld = dev_get_drvdata(dev); return scnprintf(buf, PAGE_SIZE, "%s\n", kempld_get_type_string(pld)); } -static DEVICE_ATTR(pld_version, S_IRUGO, kempld_version_show, NULL); -static DEVICE_ATTR(pld_specification, S_IRUGO, kempld_specification_show, - NULL); -static DEVICE_ATTR(pld_type, S_IRUGO, kempld_type_show, NULL); +static DEVICE_ATTR_RO(pld_version); +static DEVICE_ATTR_RO(pld_specification); +static DEVICE_ATTR_RO(pld_type); static struct attribute *pld_attributes[] = { &dev_attr_pld_version.attr, From patchwork Wed Jun 2 11:43:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 12294001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26803C4708F for ; Wed, 2 Jun 2021 12:08:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ECAD9613BA for ; Wed, 2 Jun 2021 12:08:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECAD9613BA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4efxlYtkLCgG6b+CXBmx71gMsgpDguSlVGYTj7kDdBw=; b=Sxp83rEqciYnoM 6H85o4qB8wW14fcRS4t+nng0tbmIGY6HQiyeLJNZkT+WrsjFT9MDFMINHwfi9baEKFhbLG5gcw7Im xn3+9LxeWE48/ek11DWkWOinmB0Ipi5rTBmjs4YlNj87XREhwPxoBqLh/mVaaOzTDb7+y/Zh6ar68 r6XizwvlnM6PIHn0livF8CJrclb5I8NmRVJfM+uDhCa9+3eo3IkdSVekqrfKAHBI6hjeGgnagkOZK OEmSf7rohEoECU0A+fC3cn4ZtjCW+54Vf82cTCwgk4xKpUcbxZRoePwWbPxq0cwKE6QLvGXjRyIhv NIVpJtElnEH8tEXrFMfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPdH-003tzR-On; Wed, 02 Jun 2021 12:06:00 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPI1-003o8r-GH for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 11:44:03 +0000 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Fw6Y82VBKz68x9; Wed, 2 Jun 2021 19:41:00 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:58 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:57 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 7/9] mfd: janz-cmodio: use DEVICE_ATTR_RO macro Date: Wed, 2 Jun 2021 19:43:37 +0800 Message-ID: <20210602114339.11223-8-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210602114339.11223-1-thunder.leizhen@huawei.com> References: <20210602114339.11223-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_044401_781451_53E45E3B X-CRM114-Status: UNSURE ( 9.92 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use DEVICE_ATTR_RO macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/mfd/janz-cmodio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c index 3df4e9a2998f490..70eba4ce496faa3 100644 --- a/drivers/mfd/janz-cmodio.c +++ b/drivers/mfd/janz-cmodio.c @@ -149,15 +149,15 @@ static int cmodio_probe_submodules(struct cmodio_device *priv) * SYSFS Attributes */ -static ssize_t mbus_show(struct device *dev, struct device_attribute *attr, - char *buf) +static ssize_t modulbus_number_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct cmodio_device *priv = dev_get_drvdata(dev); return snprintf(buf, PAGE_SIZE, "%x\n", priv->hex); } -static DEVICE_ATTR(modulbus_number, S_IRUGO, mbus_show, NULL); +static DEVICE_ATTR_RO(modulbus_number); static struct attribute *cmodio_sysfs_attrs[] = { &dev_attr_modulbus_number.attr, From patchwork Wed Jun 2 11:43:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 12294003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2554CC47083 for ; Wed, 2 Jun 2021 12:09:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E8E1E613B1 for ; Wed, 2 Jun 2021 12:09:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8E1E613B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BkaZ5ZVZKnMtsPVOUucvmi2EykISL9yrho6ONpyjw38=; b=1xFeRttwMZn+ah x0oO+dm0dqk0h3dUrbePKOKe6TmPowxvXGTI/i+F20arYrDMU5hwIyzpaMj/K4MbNPjusNyDoTGoV J1e/2iYEQiCkW++YcbC9oZB6KrWTGmeMiR1ihLio/R9bmZq1pwWKMQeatH2/7nRciSQch9d0xshJc ipmtcd29fEc9MdcBBDM/e75Tc/ycf9deRqXg4AWgnfzI2B8FdDI018eCQ6AjmbscMTANiHxXNRNb+ WqXKnkWglIkHsF8ehh5ywVL7uzSW3X6u9+K3758Erxde5MkRBVhGIB8N+MS3JuP/5hFJuZCrG+j2y 2FdChbj3098zu98O9rZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPen-003uaE-VZ; Wed, 02 Jun 2021 12:07:34 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPI1-003o93-GI for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 11:44:05 +0000 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Fw6W75b3xzWp49; Wed, 2 Jun 2021 19:39:15 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:58 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:58 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 8/9] mfd: intel_soc_pmic_bxtwc: use DEVICE_ATTR_ADMIN_RW macro Date: Wed, 2 Jun 2021 19:43:38 +0800 Message-ID: <20210602114339.11223-9-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210602114339.11223-1-thunder.leizhen@huawei.com> References: <20210602114339.11223-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_044401_820421_5D66EFCE X-CRM114-Status: GOOD ( 10.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use DEVICE_ATTR_ADMIN_RW macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/mfd/intel_soc_pmic_bxtwc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c index 47d0d3a69a58a37..bc069c4daa60393 100644 --- a/drivers/mfd/intel_soc_pmic_bxtwc.c +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c @@ -330,14 +330,14 @@ static int regmap_ipc_byte_reg_write(void *context, unsigned int reg, /* sysfs interfaces to r/w PMIC registers, required by initial script */ static unsigned long bxtwc_reg_addr; -static ssize_t bxtwc_reg_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t addr_show(struct device *dev, + struct device_attribute *attr, char *buf) { return sprintf(buf, "0x%lx\n", bxtwc_reg_addr); } -static ssize_t bxtwc_reg_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) +static ssize_t addr_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) { if (kstrtoul(buf, 0, &bxtwc_reg_addr)) { dev_err(dev, "Invalid register address\n"); @@ -346,8 +346,8 @@ static ssize_t bxtwc_reg_store(struct device *dev, return (ssize_t)count; } -static ssize_t bxtwc_val_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t val_show(struct device *dev, + struct device_attribute *attr, char *buf) { int ret; unsigned int val; @@ -362,8 +362,8 @@ static ssize_t bxtwc_val_show(struct device *dev, return sprintf(buf, "0x%02x\n", val); } -static ssize_t bxtwc_val_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) +static ssize_t val_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) { int ret; unsigned int val; @@ -382,8 +382,8 @@ static ssize_t bxtwc_val_store(struct device *dev, return count; } -static DEVICE_ATTR(addr, S_IWUSR | S_IRUSR, bxtwc_reg_show, bxtwc_reg_store); -static DEVICE_ATTR(val, S_IWUSR | S_IRUSR, bxtwc_val_show, bxtwc_val_store); +static DEVICE_ATTR_ADMIN_RW(addr); +static DEVICE_ATTR_ADMIN_RW(val); static struct attribute *bxtwc_attrs[] = { &dev_attr_addr.attr, &dev_attr_val.attr, From patchwork Wed Jun 2 11:43:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 12294041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17660C47083 for ; Wed, 2 Jun 2021 12:18:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBB6160FDC for ; Wed, 2 Jun 2021 12:18:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBB6160FDC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6aMO59EgWJyjAR9lnP5kBe0MQz3I08ZQqSiuv6vogfI=; b=CZBO16IHrU0ryE 0y96SZiHyKd7qQwo9Npohy4j+gRxWvnG/T16WTGheJPNQhywUBdZdaF5QFQa8Afd/nxe9AIF5xg1G 3klumj6PZ3U6rtwodV121xJaDOHX+Z2F6Q53a879ctkuWtwr9d/8V4S1jSapI1D0ZuImWsZglHV0Q DirN+lFzf7rYZ8cKGD51boolq025l7ckoACJunhFsHQILEcifpfJf1tSzmQyEIuOPMP4hNPnAgg1C Qa3wqXw5lLDjIZ+kwKqdYao1iC9N0sblxKisIMSNeNn2pFssy+TFQF6v4LakPLxYJHYKudhsCE2Ic P5XtvKxzjIsZZKYm6MRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPmj-003xfX-Sp; Wed, 02 Jun 2021 12:15:47 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loPI1-003o9B-QQ for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 11:44:06 +0000 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Fw6Y95rBmz693t; Wed, 2 Jun 2021 19:41:01 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:59 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:58 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 9/9] mfd: ab8500-core: use DEVICE_ATTR_RO/RW macro Date: Wed, 2 Jun 2021 19:43:39 +0800 Message-ID: <20210602114339.11223-10-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210602114339.11223-1-thunder.leizhen@huawei.com> References: <20210602114339.11223-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_044402_334181_B5994863 X-CRM114-Status: UNSURE ( 9.35 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use DEVICE_ATTR_RO/RW macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/mfd/ab8500-core.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index c2ba498ad302dcd..30489670ea528ce 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -827,8 +827,8 @@ static const struct mfd_cell ab8540_cut2_devs[] = { }, }; -static ssize_t show_chip_id(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t chip_id_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct ab8500 *ab8500; @@ -848,8 +848,8 @@ static ssize_t show_chip_id(struct device *dev, * 0x40 Power on key 1 pressed longer than 10 seconds * 0x80 DB8500 thermal shutdown */ -static ssize_t show_switch_off_status(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t switch_off_status_show(struct device *dev, + struct device_attribute *attr, char *buf) { int ret; u8 value; @@ -883,8 +883,8 @@ void ab8500_override_turn_on_stat(u8 mask, u8 set) * 0x40 UsbIDDetect * 0x80 Reserved */ -static ssize_t show_turn_on_status(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t turn_on_status_show(struct device *dev, + struct device_attribute *attr, char *buf) { int ret; u8 value; @@ -912,8 +912,8 @@ static ssize_t show_turn_on_status(struct device *dev, return sprintf(buf, "%#x\n", value); } -static ssize_t show_turn_on_status_2(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t turn_on_status_2_show(struct device *dev, + struct device_attribute *attr, char *buf) { int ret; u8 value; @@ -927,8 +927,8 @@ static ssize_t show_turn_on_status_2(struct device *dev, return sprintf(buf, "%#x\n", (value & 0x1)); } -static ssize_t show_ab9540_dbbrstn(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t dbbrstn_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct ab8500 *ab8500; int ret; @@ -945,7 +945,7 @@ static ssize_t show_ab9540_dbbrstn(struct device *dev, (value & AB9540_MODEM_CTRL2_SWDBBRSTN_BIT) ? 1 : 0); } -static ssize_t store_ab9540_dbbrstn(struct device *dev, +static ssize_t dbbrstn_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct ab8500 *ab8500; @@ -980,12 +980,11 @@ static ssize_t store_ab9540_dbbrstn(struct device *dev, return ret; } -static DEVICE_ATTR(chip_id, S_IRUGO, show_chip_id, NULL); -static DEVICE_ATTR(switch_off_status, S_IRUGO, show_switch_off_status, NULL); -static DEVICE_ATTR(turn_on_status, S_IRUGO, show_turn_on_status, NULL); -static DEVICE_ATTR(turn_on_status_2, S_IRUGO, show_turn_on_status_2, NULL); -static DEVICE_ATTR(dbbrstn, S_IRUGO | S_IWUSR, - show_ab9540_dbbrstn, store_ab9540_dbbrstn); +static DEVICE_ATTR_RO(chip_id); +static DEVICE_ATTR_RO(switch_off_status); +static DEVICE_ATTR_RO(turn_on_status); +static DEVICE_ATTR_RO(turn_on_status_2); +static DEVICE_ATTR_RW(dbbrstn); static struct attribute *ab8500_sysfs_entries[] = { &dev_attr_chip_id.attr,