All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v1 04/10] xhci: dbc: Use ATTRIBUTE_GROUPS()
Date: Wed, 11 Oct 2023 17:18:16 +0300	[thread overview]
Message-ID: <a903222f-b501-13b4-94ce-efbcc2afd3b6@linux.intel.com> (raw)
In-Reply-To: <20231002161610.2648818-4-andriy.shevchenko@linux.intel.com>

On 2.10.2023 19.16, Andy Shevchenko wrote:
> Embrace ATTRIBUTE_GROUPS() to avoid boiler plate code.
> This should not introduce any functional changes.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/usb/host/xhci-dbgcap.c | 11 ++++-------
>   1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c
> index 92869c67a430..3c90410e9cde 100644
> --- a/drivers/usb/host/xhci-dbgcap.c
> +++ b/drivers/usb/host/xhci-dbgcap.c
> @@ -1124,7 +1124,7 @@ static DEVICE_ATTR_RW(dbc_idProduct);
>   static DEVICE_ATTR_RW(dbc_bcdDevice);
>   static DEVICE_ATTR_RW(dbc_bInterfaceProtocol);
>   
> -static struct attribute *dbc_dev_attributes[] = {
> +static struct attribute *dbc_dev_attrs[] = {
>   	&dev_attr_dbc.attr,
>   	&dev_attr_dbc_idVendor.attr,
>   	&dev_attr_dbc_idProduct.attr,
> @@ -1132,10 +1132,7 @@ static struct attribute *dbc_dev_attributes[] = {
>   	&dev_attr_dbc_bInterfaceProtocol.attr,
>   	NULL
>   };
> -
> -static const struct attribute_group dbc_dev_attrib_grp = {
> -	.attrs = dbc_dev_attributes,
> -};
> +ATTRIBUTE_GROUPS(dbc_dev);
>   
>   struct xhci_dbc *
>   xhci_alloc_dbc(struct device *dev, void __iomem *base, const struct dbc_driver *driver)
> @@ -1161,7 +1158,7 @@ xhci_alloc_dbc(struct device *dev, void __iomem *base, const struct dbc_driver *
>   	INIT_DELAYED_WORK(&dbc->event_work, xhci_dbc_handle_events);
>   	spin_lock_init(&dbc->lock);
>   
> -	ret = sysfs_create_group(&dev->kobj, &dbc_dev_attrib_grp);
> +	ret = sysfs_create_groups(&dev->kobj, &dbc_dev_groups)  
Compiler warns:

drivers/usb/host/xhci-dbgcap.c:1186:40: error: passing argument 2 of ‘sysfs_create_groups’ from incompatible pointer type

should probably be:
sysfs_create_groups(&dev->kobj, dbc_dev_groups)

-Mathias



  reply	other threads:[~2023-10-11 14:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-02 16:16 [PATCH v1 01/10] xhci: dbc: Drop duplicate checks for dma_free_coherent() Andy Shevchenko
2023-10-02 16:16 ` [PATCH v1 02/10] xhci: dbc: Convert to use sysfs_streq() Andy Shevchenko
2023-10-02 16:16 ` [PATCH v1 03/10] xhci: dbc: Use sysfs_emit() to instead of scnprintf() Andy Shevchenko
2023-10-02 18:03   ` kernel test robot
2023-10-03  8:50     ` Andy Shevchenko
2023-10-03 12:30       ` Mathias Nyman
2023-10-02 16:16 ` [PATCH v1 04/10] xhci: dbc: Use ATTRIBUTE_GROUPS() Andy Shevchenko
2023-10-11 14:18   ` Mathias Nyman [this message]
2023-10-02 16:16 ` [PATCH v1 05/10] xhci: dbc: Check for errors first in xhci_dbc_stop() Andy Shevchenko
2023-10-02 16:16 ` [PATCH v1 06/10] xhci: dbc: Don't shadow error codes in store() functions Andy Shevchenko
2023-10-02 16:16 ` [PATCH v1 07/10] xhci: dbc: Replace custom return value with proper Linux error code Andy Shevchenko
2023-10-02 16:16 ` [PATCH v1 08/10] xhci: dbc: Use sizeof_field() where it makes sense Andy Shevchenko
2023-10-02 16:16 ` [PATCH v1 09/10] xhci: dbc: Use sizeof(*pointer) instead of sizeof(type) Andy Shevchenko
2023-10-02 16:16 ` [PATCH v1 10/10] xhci: dbc: Add missing headers Andy Shevchenko
2023-10-11 14:20   ` Mathias Nyman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a903222f-b501-13b4-94ce-efbcc2afd3b6@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.