On Sunday 08 June 2008 02:08:14 Steve Brown wrote:
> This adds support for the ehci host function of the USB20 ssb core in 
> the Broadcom BCM5354 to the ehci-hcd driver. That core implements both 
> ehci and ohci. The driver is implemented as a library or extension to 
> the ohci-ssb support in the ohci-hcd driver and is not standalone. It 
> must load before the ohci-hcd driver.
> 
> Signed-off-by: Steve Brown <[EMAIL PROTECTED]>
> 
> ---
> 
> 
> 

++      if (dev->id.coreid == SSB_DEV_USB20_HOST) {
++              ohcidev->companion = &dev->bus->devices[dev->bus->nr_devices];
++              dev->bus->nr_devices++;
++              if (dev->bus->nr_devices > ARRAY_SIZE(dev->bus->devices)) {
++                      printk(KERN_ERR 
++                              "More than %d devs, could not create ohci dev 
(%d)\n",
++                              SSB_MAX_NR_CORES, dev->bus->nr_devices);
++                              return err;
++              }
++              memcpy(ohcidev->companion, dev, sizeof(struct ssb_device));
++              err = ssb_ehci_attach(ohcidev->companion);
++      }

I still really don't like this.
Why do you copy the device? This is going to cause all kinds of weird problems
with refcounts and so on.
You should simply share one device between the modules.
Simply get rid of all this "companion" logic and share the pointer.

The rest looks OK (except for indentation errors)

-- 
Greetings Michael.
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to