Google
  Web www.spinics.net

Re: [PATCH] USB: add support for SuperH OHCI

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


Alan Stern wrote:
> On Thu, 10 Jan 2008, Yoshihiro Shimoda wrote:
> 
>> add support for SuperH OHCI.
> 
>> +static int usb_ohci_sh_probe(const struct hc_driver *driver,
>> +				struct platform_device *pdev)
>> +{
>> +	struct resource *res = NULL;
>> +	int irq = -1;
>> +	struct usb_hcd *hcd = NULL;
>> +	int ret = 0;
>> +
>> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> +	if (!res) {
>> +		ret = -ENODEV;
>> +		err("platform_get_resource_byname error.");
>> +		goto clean_up;
>> +	}
>> +
>> +	irq = platform_get_irq(pdev, 0);
>> +	if (irq < 0) {
>> +		ret = -ENODEV;
>> +		err("platform_get_irq error.");
>> +		goto clean_up;
>> +	}
>> +
>> +	/* initialize hcd */
>> +	hcd = usb_create_hcd(driver, &pdev->dev, (char *)hcd_name);
>> +	if (!hcd) {
>> +		ret = -ENOMEM;
>> +		err("Failed to create hcd");
>> +		goto clean_up;
>> +	}
>> +
>> +	hcd->regs = (void __iomem *)res->start;
>> +	hcd->rsrc_start = res->start;
>> +	hcd->rsrc_len = resource_len(res);
>> +	ret = usb_add_hcd(hcd, irq, 0);
> 
> The last argument should be IRQF_DISABLED, not 0.
> 
>> +	if (ret != 0) {
>> +		err("Failed to add hcd");
>> +		goto clean_up;
> 
> This line should be "usb_put_hcd(hcd);" instead of "goto clean_up;".
> 
>> +	}
>> +
>> +clean_up:
>> +	return ret;
>> +}
> 
> "clean_up" isn't a very good label, because the code doesn't 
> actually clean up anything.  It just returns.

Thank you for your comments. I will modify driver code.

Tanks,
Yoshihiro Shimoda

> Alan Stern
> 


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

[Home]     [Video for Linux]     [Photo]     [Yosemite Forum]     [Yosemite Photos]    [Video Projectors]     [PDAs]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [Free Dating]

  Powered by Linux