* fix compiler warning in adm5120-hcd.c
* allocate mem_resource with the correct size
* fix driver name in the platform device structure
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8331
3c298f89-4303-0410-b956-
a3cf2f4a3e73
};
struct platform_device adm5120_usbc_device = {
};
struct platform_device adm5120_usbc_device = {
- .name = "adm5120-usbc",
.id = -1,
.num_resources = ARRAY_SIZE(adm5120_usbc_resources),
.resource = adm5120_usbc_resources,
.id = -1,
.num_resources = ARRAY_SIZE(adm5120_usbc_resources),
.resource = adm5120_usbc_resources,
#define ADMHCD_SOFI 0x00000010 /* SOF transmitted/received, host mode */
#define ADMHCD_REG_INTENABLE 0x08
#define ADMHCD_INT_EN 0x80000000 /* Interrupt enable */
#define ADMHCD_SOFI 0x00000010 /* SOF transmitted/received, host mode */
#define ADMHCD_REG_INTENABLE 0x08
#define ADMHCD_INT_EN 0x80000000 /* Interrupt enable */
-#define ADMHCD_INTMASK 0x00000001 /* Interrupt mask */
+#define ADMHCD_INTMASK 0x00000001 /* Interrupt mask */
#define ADMHCD_REG_HOSTCONTROL 0x10
#define ADMHCD_DMA_EN 0x00000004 /* USB host DMA enable */
#define ADMHCD_STATE_RST 0x00000000 /* bus state reset */
#define ADMHCD_REG_HOSTCONTROL 0x10
#define ADMHCD_DMA_EN 0x00000004 /* USB host DMA enable */
#define ADMHCD_STATE_RST 0x00000000 /* bus state reset */
printk(KERN_WARNING PFX "waiting for reset to complete\n");
mdelay(1);
}
printk(KERN_WARNING PFX "waiting for reset to complete\n");
mdelay(1);
}
hcd->uses_new_polling = 1;
/* Enable USB host mode */
hcd->uses_new_polling = 1;
/* Enable USB host mode */
- printk(KERN_WARNING "%s Software reset timeout\n", hcd_name);
+ printk(KERN_WARNING "%s: software reset timeout\n", hcd_name);
ret = -ETIME;
}
spin_unlock_irqrestore(&ahcd->lock, flags);
ret = -ETIME;
}
spin_unlock_irqrestore(&ahcd->lock, flags);
- printk(KERN_WARNING "Device not ready after %dms\n", timeout);
+ printk(KERN_WARNING "%s: device not ready after %dms\n",
+ hcd_name, timeout);
ret = -ENODEV;
}
return ret;
ret = -ENODEV;
}
return ret;
spin_lock_irqsave(&ahcd->lock, flags);
admhcd_reg_set(ahcd, ADMHCD_REG_INTENABLE, 0);
spin_lock_irqsave(&ahcd->lock, flags);
admhcd_reg_set(ahcd, ADMHCD_REG_INTENABLE, 0);
/* Set global control of power for ports */
val = admhcd_reg_get(ahcd, ADMHCD_REG_RHDESCR);
val &= (~ADMHCD_PSM | ADMHCD_LPS);
/* Set global control of power for ports */
val = admhcd_reg_get(ahcd, ADMHCD_REG_RHDESCR);
val &= (~ADMHCD_PSM | ADMHCD_LPS);
- if (!request_mem_region(data->start, 2, hcd_name)) {
+ if (!request_mem_region(data->start, resource_len(data), hcd_name)) {
printk(KERN_DEBUG PFX "cannot request memory regions for the data resource\n");
err = -EBUSY;
goto out;
}
data_reg = ioremap(data->start, resource_len(data));
printk(KERN_DEBUG PFX "cannot request memory regions for the data resource\n");
err = -EBUSY;
goto out;
}
data_reg = ioremap(data->start, resource_len(data));
if (data_reg == NULL) {
printk(KERN_DEBUG PFX "unable to ioremap\n");
err = -ENOMEM;
if (data_reg == NULL) {
printk(KERN_DEBUG PFX "unable to ioremap\n");
err = -ENOMEM;
if (!hcd) {
printk(KERN_DEBUG PFX "unable to create the hcd\n");
err = -ENOMEM;
if (!hcd) {
printk(KERN_DEBUG PFX "unable to create the hcd\n");
err = -ENOMEM;
}
hcd->rsrc_start = data->start;
hcd->rsrc_len = resource_len(data);
hcd->regs = data_reg;
}
hcd->rsrc_start = data->start;
hcd->rsrc_len = resource_len(data);
hcd->regs = data_reg;
ahcd = hcd_to_admhcd(hcd);
ahcd->data_reg = data_reg;
ahcd->base = (u32)data_reg;
ahcd = hcd_to_admhcd(hcd);
ahcd->data_reg = data_reg;
ahcd->base = (u32)data_reg;
}
static void __exit adm5120hcd_exit(void)
}
static void __exit adm5120hcd_exit(void)
platform_driver_unregister(&adm5120hcd_driver);
printk(KERN_INFO PFX "driver unregistered\n");
}
platform_driver_unregister(&adm5120hcd_driver);
printk(KERN_INFO PFX "driver unregistered\n");
}