Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7895395rwd; Tue, 20 Jun 2023 07:36:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5AcI2JleLGf2GXsVkBBjs06TlvjCDut4qnM8/mf7SGqHyLrDkns2UDpI+1sDSUs4uqmhSe X-Received: by 2002:a92:4b02:0:b0:340:5860:e823 with SMTP id m2-20020a924b02000000b003405860e823mr11017655ilg.32.1687271805243; Tue, 20 Jun 2023 07:36:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687271805; cv=none; d=google.com; s=arc-20160816; b=NfVK3XR4FMhBzLW1DBziNdN9ai0+hRoHk2LsIpq1fp4kjzqlnJWVM6A+GvpL5XJ/HB FWuKwTaIhhro4q2lfU719lh5SFln3KZ04i9b8azUhJa1doBlxFO5Ti45Peh14tiLE2Sv d6/612NKYgkdQ3V6F6828FJIGa660qh6AcBnn2rtsbf72St4bdCU7OxfMIChgKjJS6Az wPMepiP9M/NXIcWUFemetExdngw8miQ8MyNsY1W+KFcq21SW9rL2yLr+TG7PbUsxsB2/ r72bki5LmN7gCIOgOMABTN+16gwtDr6DM6K/+y7l7I9PUuos6dWX8FRXez7b6gvvl4u/ Z6mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8SIpAWwEXWh+2s4C9M/ZFMOhqkGOD4GJqdqOvJ/wEc4=; b=bw4uHEakX+M2i651+f8VA0t6bgnv26zPy6JACIPBbmaEP+VvcLHUeMIEY/M7ad72ou YLPshfuA11YEB7Qm4MyM7bCHBocovYhNrOZKqUnN7SdFqZRpkOdK0WeqSZDmY/WyyTXC 4MOlhDrmmvNcheQDbvb+X9gD9B6vZ/tf0RmszVfn9ly8kDjc4cLtETPStghXBEMIER3y jjYR6T+yaCnzT55RefYtyV+Ui6fFtBia/jsq9YUhUyA4AOf917RlY1Pjlw4+Xgvxseor LTmlEAgUcFamTtKwvZmD1ZDDDI9En49N1h6wDm+2TP6Bl8GGAd3RqXfFCMehou7fyUgu BJ3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=wao+769J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k137-20020a636f8f000000b0053fbb36fc65si1866302pgc.382.2023.06.20.07.36.32; Tue, 20 Jun 2023 07:36:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=wao+769J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232860AbjFTOAV (ORCPT + 99 others); Tue, 20 Jun 2023 10:00:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232760AbjFTOAO (ORCPT ); Tue, 20 Jun 2023 10:00:14 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ECA4E60; Tue, 20 Jun 2023 07:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition: In-Reply-To:References; bh=8SIpAWwEXWh+2s4C9M/ZFMOhqkGOD4GJqdqOvJ/wEc4=; b=wa o+769JSs2dCeQkSQKZ75nrAIJ5JwjvsRnNbk/7Okb8A9zJwNxCjJ8oaAXa/Ah2Hf/c4thvdTjBk1J FqatkyncShBoaYqnkp1k5+tfPJ17j7T60QMtOKbOBN0eUThvTO5/Xm108WvHMfMLg9PwiQS80rlNJ OD5Ak+wpBR+aQig=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qBbID-00Gzyr-OC; Tue, 20 Jun 2023 15:21:09 +0200 Date: Tue, 20 Jun 2023 15:21:09 +0200 From: Andrew Lunn To: Kalesh Anakkur Purayil Cc: Christian Marangi , Pavel Machek , Lee Jones , "David S. Miller" , Dan Carpenter , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [net-next PATCH v5 3/3] leds: trigger: netdev: expose hw_control status via sysfs Message-ID: <71dfdbf0-09a3-4079-954f-cb87fe9b1817@lunn.ch> References: <20230619204700.6665-1-ansuelsmth@gmail.com> <20230619204700.6665-4-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static ssize_t hw_control_show(struct device *dev, > +? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct device_attribute *attr, char *buf) > +{ > +? ? ? ?struct led_netdev_data *trigger_data = led_trigger_get_drvdata > (dev); > + > +? ? ? ?return sprintf(buf, "%d\n", trigger_data->hw_control); > > [Kalesh]: How about using sysfs_emit?? Currently, there are zero instances of sysfs_emit() in ledtrig-netdev, and in any files in drivers/leds/trigger/, or even drivers/leds. So i think it would be better to keep this consistent with the rest of the code in this file, and have a follow up patchset which reviews and converts the 52 sprintf() in drivers/leds. Andrew