Re: [PATCH v5 2/4] USB: misc: Add onboard_usb_hub driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Matthias,

I love your patch! Perhaps something to improve:

[auto build test WARNING on usb/usb-testing]
[also build test WARNING on robh/for-next char-misc/char-misc-testing v5.11-rc7 next-20210125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Matthias-Kaehlcke/USB-misc-Add-onboard_usb_hub-driver/20210211-011551
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/15c43f13a680dab0efc2816a9d632d9d6482b6fc
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Matthias-Kaehlcke/USB-misc-Add-onboard_usb_hub-driver/20210211-011551
        git checkout 15c43f13a680dab0efc2816a9d632d9d6482b6fc
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> drivers/usb/misc/onboard_usb_hub.c:277:6: warning: no previous prototype for 'of_is_onboard_usb_hub' [-Wmissing-prototypes]
     277 | bool of_is_onboard_usb_hub(const struct device_node *np)
         |      ^~~~~~~~~~~~~~~~~~~~~
   drivers/usb/misc/onboard_usb_hub.c: In function 'onboard_hub_probe':
>> drivers/usb/misc/onboard_usb_hub.c:234:8: warning: ignoring return value of 'driver_attach', declared with attribute warn_unused_result [-Wunused-result]
     234 |  (void)driver_attach(&onboard_hub_usbdev_driver.drvwrap.driver);
         |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
   Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
   Selected by
   - SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
   - SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC


vim +/of_is_onboard_usb_hub +277 drivers/usb/misc/onboard_usb_hub.c

   199	
   200	static int onboard_hub_probe(struct platform_device *pdev)
   201	{
   202		struct device *dev = &pdev->dev;
   203		struct onboard_hub *hub;
   204		int err;
   205	
   206		hub = devm_kzalloc(dev, sizeof(*hub), GFP_KERNEL);
   207		if (!hub)
   208			return -ENOMEM;
   209	
   210		hub->vdd = devm_regulator_get(dev, "vdd");
   211		if (IS_ERR(hub->vdd))
   212			return PTR_ERR(hub->vdd);
   213	
   214		hub->dev = dev;
   215		mutex_init(&hub->lock);
   216		INIT_LIST_HEAD(&hub->udev_list);
   217	
   218		dev_set_drvdata(dev, hub);
   219	
   220		err = devm_device_add_group(dev, &onboard_hub_sysfs_group);
   221		if (err) {
   222			dev_err(dev, "failed to create sysfs entries: %d\n", err);
   223			return err;
   224		}
   225	
   226		err = onboard_hub_power_on(hub);
   227		if (err)
   228			return err;
   229	
   230		/*
   231		 * The USB driver might have been detached from the USB devices by
   232		 * onboard_hub_remove() make sure to re-attach it if needed.
   233		 */
 > 234		(void)driver_attach(&onboard_hub_usbdev_driver.drvwrap.driver);
   235	
   236		return 0;
   237	}
   238	
   239	static int onboard_hub_remove(struct platform_device *pdev)
   240	{
   241		struct onboard_hub *hub = dev_get_drvdata(&pdev->dev);
   242		struct udev_node *node;
   243		struct usb_device *udev;
   244	
   245		hub->going_away = true;
   246	
   247		mutex_lock(&hub->lock);
   248	
   249		/* unbind the USB devices to avoid dangling references to this device */
   250		while (!list_empty(&hub->udev_list)) {
   251			node = list_first_entry(&hub->udev_list, struct udev_node, list);
   252			udev = node->udev;
   253	
   254			/*
   255			 * Unbinding the driver will call onboard_hub_remove_usbdev(),
   256			 * which acquires hub->lock.  We must release the lock first.
   257			 */
   258			get_device(&udev->dev);
   259			mutex_unlock(&hub->lock);
   260			device_release_driver(&udev->dev);
   261			put_device(&udev->dev);
   262			mutex_lock(&hub->lock);
   263		}
   264	
   265		mutex_unlock(&hub->lock);
   266	
   267		return onboard_hub_power_off(hub);
   268	}
   269	
   270	static const struct of_device_id onboard_hub_match[] = {
   271		{ .compatible = "usbbda,411" },
   272		{ .compatible = "usbbda,5411" },
   273		{}
   274	};
   275	MODULE_DEVICE_TABLE(of, onboard_hub_match);
   276	
 > 277	bool of_is_onboard_usb_hub(const struct device_node *np)
   278	{
   279		return !!of_match_node(onboard_hub_match, np);
   280	}
   281	EXPORT_SYMBOL_GPL(of_is_onboard_usb_hub);
   282	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux