From patchwork Tue Nov 24 12:44:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 11928471 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=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 4A3D0C64E7A for ; Tue, 24 Nov 2020 12:47:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F2E142076B for ; Tue, 24 Nov 2020 12:47:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="Qu+DjpwI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387681AbgKXMr0 (ORCPT ); Tue, 24 Nov 2020 07:47:26 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:39770 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387678AbgKXMr0 (ORCPT ); Tue, 24 Nov 2020 07:47:26 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0AOClIDZ032919; Tue, 24 Nov 2020 06:47:18 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1606222038; bh=puc3vI/lLOm66B3jJb/sSEvZUujOhpDNx9am76rdnYE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Qu+DjpwIcmFiMZ8fiWZW6X1STsD1O0d87+AuzXgYLRI37BckTRs/bjBoCcjxrwjmu XTOSANr2Ryl5PLjQ4PUgqM6x08i7u9MIdN62FmWZELTaQ+87inqSLI/849uE7TCwVY NK0mDbWgTE+MdqWOliQBhPmx0Mi3THZmjf/jVE9U= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0AOClI92043375 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 24 Nov 2020 06:47:18 -0600 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 24 Nov 2020 06:47:17 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 24 Nov 2020 06:47:17 -0600 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0AOCjmpO040922; Tue, 24 Nov 2020 06:47:15 -0600 From: Tomi Valkeinen To: Sebastian Reichel , Laurent Pinchart , Nikhil Devshatwar , , CC: Sekhar Nori , Tony Lindgren , , Sebastian Reichel , Tomi Valkeinen Subject: [PATCH v4 35/80] drm/omap: panel-dsi-cm: use DEVICE_ATTR_RO Date: Tue, 24 Nov 2020 14:44:53 +0200 Message-ID: <20201124124538.660710-36-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201124124538.660710-1-tomi.valkeinen@ti.com> References: <20201124124538.660710-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Sebastian Reichel Use DEVICE_ATTR_RO helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Sebastian Reichel Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 5d6a001f8f71..c50cefab6f3f 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -215,7 +215,7 @@ static const struct backlight_ops dsicm_bl_ops = { .update_status = dsicm_bl_update_status, }; -static ssize_t dsicm_num_errors_show(struct device *dev, +static ssize_t num_dsi_errors_show(struct device *dev, struct device_attribute *attr, char *buf) { struct panel_drv_data *ddata = dev_get_drvdata(dev); @@ -235,7 +235,7 @@ static ssize_t dsicm_num_errors_show(struct device *dev, return snprintf(buf, PAGE_SIZE, "%d\n", errors); } -static ssize_t dsicm_hw_revision_show(struct device *dev, +static ssize_t hw_revision_show(struct device *dev, struct device_attribute *attr, char *buf) { struct panel_drv_data *ddata = dev_get_drvdata(dev); @@ -255,8 +255,8 @@ static ssize_t dsicm_hw_revision_show(struct device *dev, return snprintf(buf, PAGE_SIZE, "%02x.%02x.%02x\n", id1, id2, id3); } -static DEVICE_ATTR(num_dsi_errors, S_IRUGO, dsicm_num_errors_show, NULL); -static DEVICE_ATTR(hw_revision, S_IRUGO, dsicm_hw_revision_show, NULL); +static DEVICE_ATTR_RO(num_dsi_errors); +static DEVICE_ATTR_RO(hw_revision); static struct attribute *dsicm_attrs[] = { &dev_attr_num_dsi_errors.attr,