lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y9ynwHvkg/0PBiFb@kroah.com>
Date:   Fri, 3 Feb 2023 07:20:48 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Martin Zaťovič <m.zatovic1@...il.com>
Cc:     linux-kernel@...r.kernel.org, robh+dt@...nel.org,
        krzysztof.kozlowski+dt@...aro.org, martin.petersen@...cle.com,
        beanhuo@...ron.com, arnd@...db.de, avri.altman@....com,
        iwona.winiarska@...el.com, fmdefrancesco@...il.com,
        dipenp@...dia.com, ogabbay@...nel.org, bvanassche@....org,
        mathieu.poirier@...aro.org, yangyicong@...ilicon.com,
        dan.j.williams@...el.com, devicetree@...r.kernel.org,
        linus.walleij@...aro.org
Subject: Re: [PATCHv2 4/4] wiegand: add Wiegand GPIO bit-banged controller
 driver

On Thu, Feb 02, 2023 at 03:33:05PM +0100, Martin Zaťovič wrote:
> +/*
> + * Attribute file for setting payload length of Wiegand messages.
> + */
> +ssize_t payload_len_show(struct device *dev, struct device_attribute *attr,
> +								 char *buf)
> +{
> +	struct wiegand_gpio *wiegand_gpio = (struct wiegand_gpio *)
> +							dev->driver_data;

No need to cast.


> +
> +	device_create_file(dev, &dev_attr_payload_len);

No, just add an attribute group pointer to your driver and the driver
core will add/remove the sysfs attributes automatically.  No need to do
it manually at all.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ