From patchwork Wed Jun 2 02:17:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 452467 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp156816jao; Tue, 1 Jun 2021 19:17:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1su7EHt0T82mQcJWRacGFUatBdcmPLe8zOGZMWtPL7ROTajIoKS9LX3aqVz3cMho78Hj5 X-Received: by 2002:a65:520a:: with SMTP id o10mr28889183pgp.172.1622600253831; Tue, 01 Jun 2021 19:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622600253; cv=none; d=google.com; s=arc-20160816; b=fZPSxyHE0299pPCLqHu6kVo5xOiV9JNpHudrbVL6nwatvXmgCrKE4WVc4gaNz1Lwkx x2k1RJVqQkjBsZhHGXFs0PpQGitFYZmSE4FaEAEnLfmrc8081IEYoqAUo5aq9vQrc3U7 OB40x/gUDi4nw0cp89U8iB4COqIOBenhv45FbegAiAZzCaroFWqnGrPtHYcUGD8nBKdF WJXYede8zbJI6SNMWPOI3+IZOpB9CFlFp7X7Y/z4+4/75627DCXQtslNfbpTSUoBtadT WsHRaLpJDdzVN7wto/caWDEZD53aLWaeE0u26KslEvrCl28+H1/CnYQk3ZC4lwuC3yb3 oGiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:delivered-to; bh=z1b21WKsy2NNaFQvclJazmprdrTNLlLRusIubN2liz0=; b=eyD90zghg7cQMvvBbIFtg63nGsHGCLZ8bItLWmhRTvoD7XriZ7p2l10zOU5OMPS2GC zrcVHiCgEik/NywyN8dQBrZAwvF34DIOrmJ7Mqm//2JytUDvSOYKlgkQJ9+MS6lJlL9P lS9UXuSSBZ3bGcNkrIU97UpCs4h9VtpvCI6YwsTNYZbGyubOfWK4Quhj1r4z/yBdiIqa F9Q/+lDW+vKJ9SIG0y8WMlm+o2ZWRU1QeySTJMhwIovTsOAUwtMHlHYzxgokYJOg4jO2 K0Eg9XOp4AueUN/LaKoNArjwSoVlaUv8IWyXOjT641daOHUn0K+8OHMw0tcmPoSFpuFs UxQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id f7si12174855plg.39.2021.06.01.19.17.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 19:17:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DA6C96EB59; Wed, 2 Jun 2021 02:17:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6028E6EB59 for ; Wed, 2 Jun 2021 02:17:30 +0000 (UTC) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Fvsyb0xLrz66rD; Wed, 2 Jun 2021 10:13:43 +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 10:17:27 +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 10:17:26 +0800 From: Zhen Lei To: Sam Ravnborg , Jani Nikula , "Greg Kroah-Hartman" , dri-devel , linux-fbdev , linux-kernel Subject: [PATCH 1/1] video: fbdev: w100fb: use DEVICE_ATTR_WO macro Date: Wed, 2 Jun 2021 10:17:16 +0800 Message-ID: <20210602021716.10640-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhen Lei Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use DEVICE_ATTR_WO macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/video/fbdev/w100fb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.26.0.106.g9fadedd diff --git a/drivers/video/fbdev/w100fb.c b/drivers/video/fbdev/w100fb.c index d96ab28f8ce4ae5..64a5e048c13f76a 100644 --- a/drivers/video/fbdev/w100fb.c +++ b/drivers/video/fbdev/w100fb.c @@ -108,7 +108,7 @@ static ssize_t flip_store(struct device *dev, struct device_attribute *attr, con static DEVICE_ATTR_RW(flip); -static ssize_t w100fb_reg_read(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t reg_read_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { unsigned long regs, param; regs = simple_strtoul(buf, NULL, 16); @@ -117,9 +117,9 @@ static ssize_t w100fb_reg_read(struct device *dev, struct device_attribute *attr return count; } -static DEVICE_ATTR(reg_read, 0200, NULL, w100fb_reg_read); +static DEVICE_ATTR_WO(reg_read); -static ssize_t w100fb_reg_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t reg_write_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { unsigned long regs, param; sscanf(buf, "%lx %lx", ®s, ¶m); @@ -132,7 +132,7 @@ static ssize_t w100fb_reg_write(struct device *dev, struct device_attribute *att return count; } -static DEVICE_ATTR(reg_write, 0200, NULL, w100fb_reg_write); +static DEVICE_ATTR_WO(reg_write); static ssize_t fastpllclk_show(struct device *dev, struct device_attribute *attr, char *buf)