From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [PATCH 1/2] libata: add ledtrig support Date: Thu, 20 Sep 2018 09:23:54 +0200 Message-ID: <20180920072354.GA20392@amd> References: <1537328730-9156-1-git-send-email-aditya@kobol.io> <1537328730-9156-2-git-send-email-aditya@kobol.io> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AqsLC8rIMeq19msA" Return-path: Content-Disposition: inline In-Reply-To: <1537328730-9156-2-git-send-email-aditya@kobol.io> Sender: linux-kernel-owner@vger.kernel.org To: Aditya Prayoga Cc: linux-ide@vger.kernel.org, linux-leds@vger.kernel.org, Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Russell King , Jens Axboe , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jacek Anaszewski , Daniel Golle List-Id: linux-leds@vger.kernel.org --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > +#ifdef CONFIG_ATA_LEDS > + /* register LED triggers for all ports */ > + for (i =3D 0; i < host->n_ports; i++) { > + if (unlikely(!host->ports[i]->ledtrig)) > + continue; > + > + snprintf(host->ports[i]->ledtrig_name, > + sizeof(host->ports[i]->ledtrig_name), "ata%u", > + host->ports[i]->print_id); > + host->ports[i]->ledtrig->name =3D host->ports[i]->ledtrig_name; > + > + if (led_trigger_register(host->ports[i]->ledtrig)) { > + kfree(host->ports[i]->ledtrig); > + host->ports[i]->ledtrig =3D NULL; > + } > + } > +#endif No, we don't want you to register multiple triggers. We want one trigger, than has parameter "which port to watch". (Number of triggers is limited as by sysfs limitations). Otherwise yes, ata trigger makes sense. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --AqsLC8rIMeq19msA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlujSwoACgkQMOfwapXb+vIkLQCeM1xnlhIVNTLBYZqEdF3DiNEH dG0AniCzufR3yA8q21j0PjHy7+Vo3TiQ =xqO6 -----END PGP SIGNATURE----- --AqsLC8rIMeq19msA--