Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp722837rdf; Fri, 3 Nov 2023 13:03:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFa9+wmiruL59dMFoYWhVmtXVbHf2YuVsj2wPzgtLamG7YO013UM6SkTzy5ZNv+XjYogGdB X-Received: by 2002:a05:6359:5e18:b0:168:cfea:2d41 with SMTP id pw24-20020a0563595e1800b00168cfea2d41mr19433082rwb.14.1699041829473; Fri, 03 Nov 2023 13:03:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699041829; cv=none; d=google.com; s=arc-20160816; b=R9wkyepoV3QXDle7Ns3ynFpFP7BQUeSf5EFyR4Ah1Nb3UApKCiY/rzB6M/xSTdLZYF g6tgmawIV9l/QFkpny76K07sCob9W8HyU/XWVymwzY08qTjyXQMchfyzmfjkDMXogWaC SAYJrPJycrnz2ucJVgRQ5Ey3byhXJfUPfLtn03MtN+BYqAcxGVBWu5ATNVousNgJWKY5 5WIxAy9IYwn+/1+06HX2wsjC6SSGpMZ3RnVP6YaNZB6P0/1cjSfyw2gq0ptSGvsy64d2 EFRxpdwjoy2k0vM4aNdMjZpseepMwu+8kJjSuT+wArrxfAbUs5igkguYChaCI0+bCfeP uspw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z78kKeQXgFS/Os5AyLn1GXC6t5R/jRvIxwXveLt6lXA=; fh=SvhOHfehUV8tt+/DHSWfRHpXzQQzyN3k16tgFjiVtw0=; b=ux6RH6GjB9SewXKia02Ol3uStaI+zoTQRoQe+MPlcfkH27fbegHp/lLKdURIts1tQJ kGKQFp02Vf52wXwbSbLqKq5zG9WNLd8UIlykGl/v1atOd5OwkUFb1BSUcBsCdkeF7S3g alcqg/4N4ca4UXFV61ZkTbfHglPth4HTKds5o+vef9+LJNU/ntZwoSK79uW1Jcr+eW5A yUVdpdcV3ayh6modvsJlRe6YbOhV3zZVfMnZoSV2lAYxvXRiEHpdzM8o0Z+FHeC/c39A WQa3g+P4lAOomzXqGzesM3lUf6KT86eCRpdYqa+1abCK/rKaMpqNY2niaxASh/ZKFNpK WrtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ka5Ntg+C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id c21-20020a631c15000000b00577616e3ad9si2038184pgc.871.2023.11.03.13.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 13:03:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ka5Ntg+C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 1BFB2806AFE1; Fri, 3 Nov 2023 13:03:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbjKCUDe (ORCPT + 99 others); Fri, 3 Nov 2023 16:03:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjKCUDd (ORCPT ); Fri, 3 Nov 2023 16:03:33 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BB1AD53; Fri, 3 Nov 2023 13:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699041809; x=1730577809; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IHEKAZwFkfBPaWXKiUvpj74KxQIC1qIeU1pZ07Sbhuk=; b=ka5Ntg+C7w4STO2qIpzuQFROo4DFF88qtg3GH56S9UtrlFwmoQPoxKLQ pzMD6vgeXBG7cbFntiBgtu2tOxS08LdLaEYXcu+G4NI0wUZdFmUdpCI44 MfkgsoqTGXCGEnyUVEVdUbzRj3chiMb3Gi4O/MaSIcuXIpCj2a65gMOH9 5s5NKgCxtkjnKzWdDGszJFlk+KHMhm85ftX0B6it+/hoIKYuuiDG4dq9s YRr0pcAMa6/F3+FRDassWoPl2S8jbK/MJ4XbrdD84DABk5dBTVfjz9G4z iRV6qlAkQg5X8tKfo4hUZWvuhNaiVUJggtHhtJi/fHXzJyAqmixmvFwWW w==; X-IronPort-AV: E=McAfee;i="6600,9927,10883"; a="420130012" X-IronPort-AV: E=Sophos;i="6.03,275,1694761200"; d="scan'208";a="420130012" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2023 13:03:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10883"; a="905446864" X-IronPort-AV: E=Sophos;i="6.03,275,1694761200"; d="scan'208";a="905446864" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 03 Nov 2023 13:03:27 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E5BE05E5; Fri, 3 Nov 2023 21:53:13 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Linus Walleij , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Pavel Machek , Lee Jones Subject: [PATCH v1 4/4] leds: trigger: gpio: Convert to DEVICE_ATTR_RW() Date: Fri, 3 Nov 2023 21:53:10 +0200 Message-Id: <20231103195310.948327-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231103195310.948327-1-andriy.shevchenko@linux.intel.com> References: <20231103195310.948327-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 03 Nov 2023 13:03:44 -0700 (PDT) Instead of custom wrapper, use DEVICE_ATTR_RW() directly. Signed-off-by: Andy Shevchenko --- drivers/leds/trigger/ledtrig-gpio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-gpio.c b/drivers/leds/trigger/ledtrig-gpio.c index 8824be19881f..7f6a2352b0ac 100644 --- a/drivers/leds/trigger/ledtrig-gpio.c +++ b/drivers/leds/trigger/ledtrig-gpio.c @@ -41,7 +41,7 @@ static irqreturn_t gpio_trig_irq(int irq, void *_led) return IRQ_HANDLED; } -static ssize_t gpio_trig_brightness_show(struct device *dev, +static ssize_t desired_brightness_show(struct device *dev, struct device_attribute *attr, char *buf) { struct gpio_trig_data *gpio_data = led_trigger_get_drvdata(dev); @@ -49,7 +49,7 @@ static ssize_t gpio_trig_brightness_show(struct device *dev, return sysfs_emit(buf, "%u\n", gpio_data->desired_brightness); } -static ssize_t gpio_trig_brightness_store(struct device *dev, +static ssize_t desired_brightness_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) { struct gpio_trig_data *gpio_data = led_trigger_get_drvdata(dev); @@ -64,8 +64,7 @@ static ssize_t gpio_trig_brightness_store(struct device *dev, return n; } -static DEVICE_ATTR(desired_brightness, 0644, gpio_trig_brightness_show, - gpio_trig_brightness_store); +static DEVICE_ATTR_RW(desired_brightness); static struct attribute *gpio_trig_attrs[] = { &dev_attr_desired_brightness.attr, -- 2.40.0.1.gaa8946217a0b