From patchwork Thu Jun 3 07:10:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 453221 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp33412jao; Thu, 3 Jun 2021 00:10:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxthGXCL5Rp9dHs7OYKGmGbqZDtFgg+Q+rEZBZ+QpVDhoP4YKF2d7vY4m4BZkIyVxl5I6qg X-Received: by 2002:a17:906:d797:: with SMTP id pj23mr17544590ejb.367.1622704255801; Thu, 03 Jun 2021 00:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622704255; cv=none; d=google.com; s=arc-20160816; b=YpgMzspW6DIzggqJBPkVbCUXz2pldo2FK84We+VV40l5e4v7otz3AznTaDWRaq/iTR kzop6zkZAD3/DV+1kYsx+kT1E29hgOLQ7TgThF+Q4K5zt66mT/J2Ke+7yOPU/CtiupBK MQLl6o8hz2+gq5BG+AHMjiWuZPmT0ZTQTL4yMfGxdrBbI34/la9SzfGiFTZVCGcAOmG6 TyR084k4XCwBXR/oIePF30er5054mUfchXrSFXYIglJaeTKa08iDQFJCP/9f+ike6GSY uENQ07KhJPICXuhtz6fMqKuw2u+FzymyS8JptXx1ZlDEnXdpO1+zS14d8r1zcrUvHoaa Uq0w== 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=s2LkexXSia5THw9Ut6/3rUOrxNObwSAEDM3FMbm/HsA=; b=zZ7TUQwGCs9LL4tr4YPTotimfRg5vt6b03l9m19ZdZNzXkhm6FwZCg1AvnadZ5aJ+Z gNqvaskfSfbxO9MhyTUaw6fpaAV4NobLT9coxLKd9uX6TF03pa5bIgQEglZn3CQOTgbX p6L3yV56FBv73rCKovaOThEzl4XDIfJv2dRqTUQuV0v1/+aUo9KccZNoN0QuKUl7/UfT XEIDczRvm+e2OqvnqaQ5hgaJ9aYPqTA7uxY8tnNKTWGkRCBKqgDRYON27i5EqkfyQnCc fjXAGwdt2IMFK6HuNQN4nZ1bfPKmc8G56hm6QawTrQS8V9zD+xIcwaBkUDJidEJTqZ6B vNCg== 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 l16si1687880ejd.23.2021.06.03.00.10.55; Thu, 03 Jun 2021 00:10:55 -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 S229641AbhFCHMC (ORCPT + 4 others); Thu, 3 Jun 2021 03:12:02 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:4290 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhFCHMB (ORCPT ); Thu, 3 Jun 2021 03:12:01 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4FwcNq4WPTz1BHRR; Thu, 3 Jun 2021 15:05:31 +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; Thu, 3 Jun 2021 15:10:15 +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:10:15 +0800 From: Zhen Lei To: Mauro Carvalho Chehab , linux-media CC: Zhen Lei Subject: [PATCH 1/1] media: bttv: use DEVICE_ATTR_RO() helper macro Date: Thu, 3 Jun 2021 15:10:09 +0800 Message-ID: <20210603071009.11438-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 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/pci/bt8xx/bttv-driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.26.0.106.g9fadedd diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 1f62a9d8ea1d323..e2e77b335c1523e 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -170,14 +170,14 @@ MODULE_VERSION(BTTV_VERSION); /* ----------------------------------------------------------------------- */ /* sysfs */ -static ssize_t show_card(struct device *cd, +static ssize_t card_show(struct device *cd, struct device_attribute *attr, char *buf) { struct video_device *vfd = to_video_device(cd); struct bttv *btv = video_get_drvdata(vfd); return sprintf(buf, "%d\n", btv ? btv->c.type : UNSET); } -static DEVICE_ATTR(card, S_IRUGO, show_card, NULL); +static DEVICE_ATTR_RO(card); /* ----------------------------------------------------------------------- */ /* dvb auto-load setup */