summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-12-15 23:02:26 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2020-12-15 23:02:26 +0100
commit7240153a9bdb77217b99b76fd73105bce12770be (patch)
treefbd0103d36e3806eef5f7aaf69155a780b83caec /drivers/usb
parentMerge tag 'tty-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gre... (diff)
parentdriver core: platform: don't oops in platform_shutdown() on unbound devices (diff)
downloadlinux-7240153a9bdb77217b99b76fd73105bce12770be.tar.xz
linux-7240153a9bdb77217b99b76fd73105bce12770be.zip
Merge tag 'driver-core-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core updates from Greg KH: "Here is the big driver core updates for 5.11-rc1 This time there was a lot of different work happening here for some reason: - redo of the fwnode link logic, speeding it up greatly - auxiliary bus added (this was a tag that will be pulled in from other trees/maintainers this merge window as well, as driver subsystems started to rely on it) - platform driver core cleanups on the way to fixing some long-time api updates in future releases - minor fixes and tweaks. All have been in linux-next with no (finally) reported issues. Testing there did helped in shaking issues out a lot :)" * tag 'driver-core-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (39 commits) driver core: platform: don't oops in platform_shutdown() on unbound devices ACPI: Use fwnode_init() to set up fwnode misc: pvpanic: Replace OF headers by mod_devicetable.h misc: pvpanic: Combine ACPI and platform drivers usb: host: sl811: Switch to use platform_get_mem_or_io() vfio: platform: Switch to use platform_get_mem_or_io() driver core: platform: Introduce platform_get_mem_or_io() dyndbg: fix use before null check soc: fix comment for freeing soc_dev_attr driver core: platform: use bus_type functions driver core: platform: change logic implementing platform_driver_probe driver core: platform: reorder functions driver core: make driver_probe_device() static driver core: Fix a couple of typos driver core: Reorder devices on successful probe driver core: Delete pointless parameter in fwnode_operations.add_links driver core: Refactor fw_devlink feature efi: Update implementation of add_links() to create fwnode links of: property: Update implementation of add_links() to create fwnode links driver core: Use device's fwnode to check if it is waiting for suppliers ...
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/sl811-hcd.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index adaf4063690a..115ced0d93e1 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -1614,12 +1614,18 @@ sl811h_probe(struct platform_device *dev)
void __iomem *addr_reg;
void __iomem *data_reg;
int retval;
- u8 tmp, ioaddr = 0;
+ u8 tmp, ioaddr;
unsigned long irqflags;
if (usb_disabled())
return -ENODEV;
+ /* the chip may be wired for either kind of addressing */
+ addr = platform_get_mem_or_io(dev, 0);
+ data = platform_get_mem_or_io(dev, 1);
+ if (!addr || !data || resource_type(addr) != resource_type(data))
+ return -ENODEV;
+
/* basic sanity checks first. board-specific init logic should
* have initialized these three resources and probably board
* specific platform_data. we don't probe for IRQs, and do only
@@ -1632,16 +1638,8 @@ sl811h_probe(struct platform_device *dev)
irq = ires->start;
irqflags = ires->flags & IRQF_TRIGGER_MASK;
- /* the chip may be wired for either kind of addressing */
- addr = platform_get_resource(dev, IORESOURCE_MEM, 0);
- data = platform_get_resource(dev, IORESOURCE_MEM, 1);
- retval = -EBUSY;
- if (!addr || !data) {
- addr = platform_get_resource(dev, IORESOURCE_IO, 0);
- data = platform_get_resource(dev, IORESOURCE_IO, 1);
- if (!addr || !data)
- return -ENODEV;
- ioaddr = 1;
+ ioaddr = resource_type(addr) == IORESOURCE_IO;
+ if (ioaddr) {
/*
* NOTE: 64-bit resource->start is getting truncated
* to avoid compiler warning, assuming that ->start