From patchwork Thu Jun 3 07:12:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 453222 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp35061jao; Thu, 3 Jun 2021 00:13:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw46Bd+Rmix0Fl/2JMVViJvLgh8wd4anW/cUQ9tGZTzkidlrZGm8so/ES6yqzhkbkIIxSwM X-Received: by 2002:a17:907:2136:: with SMTP id qo22mr16683974ejb.40.1622704421391; Thu, 03 Jun 2021 00:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622704421; cv=none; d=google.com; s=arc-20160816; b=0v1Cic+Slc7P+Jm8JKD2o+/ObtlpELqpX81Ygp+E4T9cisaJZ7Pz3FXKYOlcjuv9m6 rO5G6oEpm0omAtbD0zczneCcubGRy/uFG7qbwxRLSOy1VWe64jNRlxsP+Ls5cgXXJsqe +hUrLPbd1xO8YN85wXd9M/dJztmHyxOIF7lHTty2p99azCuIW6gW2Kp0Xf8IW3aX+zWU 8ciMHAWJHLcfrehxKbfSFyDOSRA78VTmGWvQATQ63m5hnnJHk9DjXQu4o0joVXP2VYS4 pcGHhoan62A2/DWwILN2c59RJn8DGK3bduN01QNuPZQdc5BeGpqUFnP057CRjKmyALmF x5fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=UV26HNBoDh7uGA1P3s2rMCxLvowMcQ1rUnV23HcW2UE=; b=XrBTAUwvRA7xwfMjyA6wv0T3oEP5OKdgZ78lViVtIfmr/pVt85UG4cUoxpaNertLUb 23fuNlrZ2OthA1LfRCTRj6Jt7TNPDUpYkJsfXUDmm5D/BmhznzkodCN52gpV0p10aius 6qgaZe61N6fdU/3PHVJyOimqUODJ5W4yPPRY5UW2yeSUe0XSIqaGSHs2+0eR0yX5CEw4 Q7Gb35LqPSDK0aJA1r+9/v+TqjXLvR0a7jXCrq5g0j+cf3L4wkU8WSxRmn1UniBPdW46 4LI8oC2ea2Y5DzEc7YEVMgzMNRXEQwGagjKEkwCgl7/E7Hl/e5O96bmJaJz2Knhwu/ky Jm3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d20si1883777ejy.157.2021.06.03.00.13.41; Thu, 03 Jun 2021 00:13:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229734AbhFCHOn (ORCPT + 4 others); Thu, 3 Jun 2021 03:14:43 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3521 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhFCHOn (ORCPT ); Thu, 3 Jun 2021 03:14:43 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4FwcVC6Q9KzYnDn; Thu, 3 Jun 2021 15:10:11 +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; Thu, 3 Jun 2021 15:12: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; Thu, 3 Jun 2021 15:12:56 +0800 From: Zhen Lei To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , linux-media CC: Zhen Lei Subject: [PATCH 1/1] media: mc-device.c: use DEVICE_ATTR_RO() helper macro Date: Thu, 3 Jun 2021 15:12:49 +0800 Message-ID: <20210603071249.11491-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: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Use DEVICE_ATTR_RO() helper macro instead of DEVICE_ATTR(), which is simpler and more readable. Due to the name of the read function of the sysfs attribute is normalized, there is a natural association. Signed-off-by: Zhen Lei --- drivers/media/mc/mc-device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.26.0.106.g9fadedd diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c index 9e56d2ad6b94b5a..cf5e459b1d96269 100644 --- a/drivers/media/mc/mc-device.c +++ b/drivers/media/mc/mc-device.c @@ -556,7 +556,7 @@ static const struct media_file_operations media_device_fops = { * sysfs */ -static ssize_t show_model(struct device *cd, +static ssize_t model_show(struct device *cd, struct device_attribute *attr, char *buf) { struct media_devnode *devnode = to_media_devnode(cd); @@ -565,7 +565,7 @@ static ssize_t show_model(struct device *cd, return sprintf(buf, "%.*s\n", (int)sizeof(mdev->model), mdev->model); } -static DEVICE_ATTR(model, S_IRUGO, show_model, NULL); +static DEVICE_ATTR_RO(model); /* ----------------------------------------------------------------------------- * Registration/unregistration