From patchwork Thu Jun 3 07:06:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 453220 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp30467jao; Thu, 3 Jun 2021 00:06:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybdsM9Ks/5jJrE8fbcnNkjqgQZA9fIs4SIaPRp+4RWGdb/7i7gbMrTpzmMMHBsjp5FLZqj X-Received: by 2002:a17:906:f111:: with SMTP id gv17mr21292497ejb.435.1622703983410; Thu, 03 Jun 2021 00:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622703983; cv=none; d=google.com; s=arc-20160816; b=JzP3oRVxPa4amWi6SZT28N7YKvpfw9x0fAPEjyNPnF1DqqcbXq0mVaaAJoCIDE8k++ iOQ4BfT3wYpA1hLvnqn//Ax/lrjncVhWiWRNEHx0qfQi13BJmCRbolRTJRz9q4st5AsV zKrAiNm+IHVzCKf4ecYLJdAv60nJpPEBjaVYgWsfLrSgdxFRS4gqupLZx4rvfGusAWvi CoIhmuqIMjSr5G7UrBvF0ImOT/nKF3DdFCspoNVvLc3hjzgY8haUAuyUXnmZiCIgNqau wFhQ2sv7EHx4/2vMgw18JGiul578bgMLwHRcUNxtnyq9oRZuwMoOBDvzYZefwRdwPdyN opMg== 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=/pkjT94Xv0KtzXReK4BP4g755A5u1U2s4ZU6tHY/Wcg=; b=M+oSTXmSjKGm2Oee4H60gV9RnppFV4W2saMFqnwQDmUY3/d0lW3SrddybnZ7Xc+W1F 0Oe5HdOZ5nHoTrw7LOyETdiO/J5QG/Idapzfj3NqZkReTMH6rI8Ojuf7aj4o+wBcdF5S i2FzV5ycOZUXInZrlp8WufwdjH+wuRdZJ3NqQhPdbYYuBRMeaFh5AnJaiuSxZ84koREe ZWSfWpjosUUYqc2USDl3yII6vt2h+zznvvNj8qRjAEDr1csarKNunZSP3RP2qH6E1gD6 LVOsDIYpDBXOkg+6mR01VCKzsGBvqVoA1XWM4YtzAuXudkChOyHFAK/QXXbsy7VmlWYf 2qfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-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 v9si1740688eds.500.2021.06.03.00.06.23; Thu, 03 Jun 2021 00:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-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 S229629AbhFCHIG (ORCPT + 4 others); Thu, 3 Jun 2021 03:08:06 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:3398 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhFCHIG (ORCPT ); Thu, 3 Jun 2021 03:08:06 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4FwcKQ5S8Kz67n9; Thu, 3 Jun 2021 15:02:34 +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:06:20 +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:06:19 +0800 From: Zhen Lei To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , linux-media , linux-arm-kernel , linux-samsung-soc CC: Zhen Lei Subject: [PATCH 1/1] media: exynos4-is: use DEVICE_ATTR_RW() helper macro Date: Thu, 3 Jun 2021 15:06:13 +0800 Message-ID: <20210603070613.11385-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-samsung-soc@vger.kernel.org Use DEVICE_ATTR_RW() helper macro instead of DEVICE_ATTR(), which is simpler and more readable. Due to the names of the read and write functions of the sysfs attribute is normalized, there is a natural association. Signed-off-by: Zhen Lei --- drivers/media/platform/exynos4-is/media-dev.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.26.0.106.g9fadedd diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index 3b8a24bb724c8e9..fa648721eaab9a5 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -1238,8 +1238,8 @@ static const struct media_device_ops fimc_md_ops = { .link_notify = fimc_md_link_notify, }; -static ssize_t fimc_md_sysfs_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t subdev_conf_mode_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct fimc_md *fmd = dev_get_drvdata(dev); @@ -1249,9 +1249,9 @@ static ssize_t fimc_md_sysfs_show(struct device *dev, return strscpy(buf, "V4L2 video node only API (vid-dev)\n", PAGE_SIZE); } -static ssize_t fimc_md_sysfs_store(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +static ssize_t subdev_conf_mode_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) { struct fimc_md *fmd = dev_get_drvdata(dev); bool subdev_api; @@ -1278,8 +1278,7 @@ static ssize_t fimc_md_sysfs_store(struct device *dev, * sub-dev - for media controller API, subdevs must be configured in user * space before starting streaming. */ -static DEVICE_ATTR(subdev_conf_mode, S_IWUSR | S_IRUGO, - fimc_md_sysfs_show, fimc_md_sysfs_store); +static DEVICE_ATTR_RW(subdev_conf_mode); static int cam_clk_prepare(struct clk_hw *hw) {