Re: [PATCH] VME: Provide access to VME bus enumeration and fix vme_user match function

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

 



On Fri, Jul 20, 2012 at 09:48:03AM +0100, Martyn Welch wrote:
> On 19/07/12 23:39, Greg Kroah-Hartman wrote:
> > On Thu, Jul 19, 2012 at 08:08:50PM +0100, Martyn Welch wrote:
> >> The match function for vme_user is completely wrong. It will blindly bind
> >> against the first VME slot on each bus (at this point that would be just the
> >> first bus as the driver can only handle one bus).
> >>
> >> The original intention (before some major subsystem changes) was that the
> >> driver bind against the slot to which the bridge was attached in the VME
> >> system and to the bus(es) provided via the "bus" module parameter.
> >>
> >> To do this cleanly (i.e. without poking arround in the subsystems internal
> >> stuctures) a functionality has been added to provide access to the bus
> >> enumeration.
> > 
> > So does this really solve the problem?  How does exporting the function
> > solve the issue?
> > 
> 
> The (modified) match function in vme_user does:
> 
> 	int cur_bus = vme_bus_get(vdev);
> 	int cur_slot = vme_slot_get(vdev);
> 
> 	for (i = 0; i < VME_USER_BUS_MAX; i++)
> 		if ((cur_bus == bus[i]) && (cur_slot == vdev->num))
> 
> It was getting cur_bus that couldn't be done without digging into the
> vme_bridge structure.
> 
> I have tested this, it causes the driver to bind to the bus/slot as described
> in the commit message.

Ok, but traditionally the "get" functions increment the reference count
of the object that is returned, which does not happen here.

Care to fix that up and resend?

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux