Re: [PATCH v5 2/8] usb: misc: onboard_hub: rename to onboard_dev

2024-02-28 Thread Javier Carrasco
On 28.02.24 19:18, Matthias Kaehlcke wrote:
> On Wed, Feb 28, 2024 at 02:51:29PM +0100, Javier Carrasco wrote:
>> This patch prepares onboad_hub to support non-hub devices by renaming
>> the driver files and their content, the headers and their references.
>>
>> The comments and descriptions have been slightly modified to keep
>> coherence and account for the specific cases that only affect onboard
>> hubs (e.g. peer-hub).
>>
>> The "hub" variables in functions where "dev" (and similar names) variables
>> already exist have been renamed to onboard_dev for clarity, which adds a
>> few lines in cases where more than 80 characters are used.
>>
>> No new functionality has been added.
>>
>> Signed-off-by: Javier Carrasco 
>> ---
>>  ...-usb-hub => sysfs-bus-platform-onboard-usb-dev} |   3 +-
>>  MAINTAINERS|   4 +-
>>  drivers/usb/core/Makefile  |   4 +-
>>  drivers/usb/core/hub.c |   8 +-
>>  drivers/usb/core/hub.h |   2 +-
>>  drivers/usb/misc/Kconfig   |  16 +-
>>  drivers/usb/misc/Makefile  |   2 +-
>>  drivers/usb/misc/onboard_usb_dev.c | 519 
>> +
>>  .../misc/{onboard_usb_hub.h => onboard_usb_dev.h}  |  28 +-
>>  ...ard_usb_hub_pdevs.c => onboard_usb_dev_pdevs.c} |  47 +-
>>  include/linux/usb/onboard_dev.h|  18 +
>>  include/linux/usb/onboard_hub.h|  18 -
>>  12 files changed, 595 insertions(+), 74 deletions(-)
> 
> This does not rename/delete onboard_usb_hub.c. With a rename there would
> probably be an actual diff for onboard_usb_dev.c instead of a new file,
> which would help with reviewing.

Thanks, I noticed that when I started working on v6 and it has been
fixed. I must have lost that one when fixing conflicts during the patch
re-ordering.

Best regards,
Javier Carrasco



Re: [PATCH v5 2/8] usb: misc: onboard_hub: rename to onboard_dev

2024-02-28 Thread Matthias Kaehlcke
On Wed, Feb 28, 2024 at 02:51:29PM +0100, Javier Carrasco wrote:
> This patch prepares onboad_hub to support non-hub devices by renaming
> the driver files and their content, the headers and their references.
> 
> The comments and descriptions have been slightly modified to keep
> coherence and account for the specific cases that only affect onboard
> hubs (e.g. peer-hub).
> 
> The "hub" variables in functions where "dev" (and similar names) variables
> already exist have been renamed to onboard_dev for clarity, which adds a
> few lines in cases where more than 80 characters are used.
> 
> No new functionality has been added.
> 
> Signed-off-by: Javier Carrasco 
> ---
>  ...-usb-hub => sysfs-bus-platform-onboard-usb-dev} |   3 +-
>  MAINTAINERS|   4 +-
>  drivers/usb/core/Makefile  |   4 +-
>  drivers/usb/core/hub.c |   8 +-
>  drivers/usb/core/hub.h |   2 +-
>  drivers/usb/misc/Kconfig   |  16 +-
>  drivers/usb/misc/Makefile  |   2 +-
>  drivers/usb/misc/onboard_usb_dev.c | 519 
> +
>  .../misc/{onboard_usb_hub.h => onboard_usb_dev.h}  |  28 +-
>  ...ard_usb_hub_pdevs.c => onboard_usb_dev_pdevs.c} |  47 +-
>  include/linux/usb/onboard_dev.h|  18 +
>  include/linux/usb/onboard_hub.h|  18 -
>  12 files changed, 595 insertions(+), 74 deletions(-)

This does not rename/delete onboard_usb_hub.c. With a rename there would
probably be an actual diff for onboard_usb_dev.c instead of a new file,
which would help with reviewing.


[PATCH v5 2/8] usb: misc: onboard_hub: rename to onboard_dev

2024-02-28 Thread Javier Carrasco
This patch prepares onboad_hub to support non-hub devices by renaming
the driver files and their content, the headers and their references.

The comments and descriptions have been slightly modified to keep
coherence and account for the specific cases that only affect onboard
hubs (e.g. peer-hub).

The "hub" variables in functions where "dev" (and similar names) variables
already exist have been renamed to onboard_dev for clarity, which adds a
few lines in cases where more than 80 characters are used.

No new functionality has been added.

Signed-off-by: Javier Carrasco 
---
 ...-usb-hub => sysfs-bus-platform-onboard-usb-dev} |   3 +-
 MAINTAINERS|   4 +-
 drivers/usb/core/Makefile  |   4 +-
 drivers/usb/core/hub.c |   8 +-
 drivers/usb/core/hub.h |   2 +-
 drivers/usb/misc/Kconfig   |  16 +-
 drivers/usb/misc/Makefile  |   2 +-
 drivers/usb/misc/onboard_usb_dev.c | 519 +
 .../misc/{onboard_usb_hub.h => onboard_usb_dev.h}  |  28 +-
 ...ard_usb_hub_pdevs.c => onboard_usb_dev_pdevs.c} |  47 +-
 include/linux/usb/onboard_dev.h|  18 +
 include/linux/usb/onboard_hub.h|  18 -
 12 files changed, 595 insertions(+), 74 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-hub 
b/Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-dev
similarity index 74%
rename from Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-hub
rename to Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-dev
index 42deb0552065..b06a48c3c85a 100644
--- a/Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-hub
+++ b/Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-dev
@@ -5,4 +5,5 @@ Contact:Matthias Kaehlcke 
linux-...@vger.kernel.org
 Description:
(RW) Controls whether the USB hub remains always powered
-   during system suspend or not.
\ No newline at end of file
+   during system suspend or not. This attribute is not
+   available for non-hub devices.
diff --git a/MAINTAINERS b/MAINTAINERS
index 8999497011a2..7ad556ecca40 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16297,8 +16297,8 @@ ONBOARD USB HUB DRIVER
 M: Matthias Kaehlcke 
 L: linux-...@vger.kernel.org
 S: Maintained
-F: Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-hub
-F: drivers/usb/misc/onboard_usb_hub.c
+F: Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-dev
+F: drivers/usb/misc/onboard_usb_dev.c
 
 ONENAND FLASH DRIVER
 M: Kyungmin Park 
diff --git a/drivers/usb/core/Makefile b/drivers/usb/core/Makefile
index 7d338e9c0657..ac006abd13b3 100644
--- a/drivers/usb/core/Makefile
+++ b/drivers/usb/core/Makefile
@@ -12,8 +12,8 @@ usbcore-$(CONFIG_OF)  += of.o
 usbcore-$(CONFIG_USB_PCI)  += hcd-pci.o
 usbcore-$(CONFIG_ACPI) += usb-acpi.o
 
-ifdef CONFIG_USB_ONBOARD_HUB
-usbcore-y  += ../misc/onboard_usb_hub_pdevs.o
+ifdef CONFIG_USB_ONBOARD_DEV
+usbcore-y  += ../misc/onboard_usb_dev_pdevs.o
 endif
 
 obj-$(CONFIG_USB)  += usbcore.o
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index ffd7c99e24a3..f85b3e928a35 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -1776,7 +1776,7 @@ static void hub_disconnect(struct usb_interface *intf)
if (hub->quirk_disable_autosuspend)
usb_autopm_put_interface(intf);
 
-   onboard_hub_destroy_pdevs(&hub->onboard_hub_devs);
+   onboard_dev_destroy_pdevs(&hub->onboard_devs);
 
kref_put(&hub->kref, hub_release);
 }
@@ -1895,7 +1895,7 @@ static int hub_probe(struct usb_interface *intf, const 
struct usb_device_id *id)
INIT_DELAYED_WORK(&hub->leds, led_work);
INIT_DELAYED_WORK(&hub->init_work, NULL);
INIT_WORK(&hub->events, hub_event);
-   INIT_LIST_HEAD(&hub->onboard_hub_devs);
+   INIT_LIST_HEAD(&hub->onboard_devs);
spin_lock_init(&hub->irq_urb_lock);
timer_setup(&hub->irq_urb_retry, hub_retry_irq_urb, 0);
usb_get_intf(intf);
@@ -1925,7 +1925,7 @@ static int hub_probe(struct usb_interface *intf, const 
struct usb_device_id *id)
}
 
if (hub_configure(hub, &desc->endpoint[0].desc) >= 0) {
-   onboard_hub_create_pdevs(hdev, &hub->onboard_hub_devs);
+   onboard_dev_create_pdevs(hdev, &hub->onboard_devs);
 
return 0;
}
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index 43ce21c96a51..3820703b11d8 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -74,7 +74,7 @@ struct usb_hub {
spinlock_t  irq_urb_lock;