RE: [PATCH 12/13 v3] OMAP: GPIO: Implement GPIO as a platform device

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

 



> [snip]
> 
> 
> > +static inline int init_gpio_info(struct platform_device *pdev)
> > +{
> > +       gpio_bank = kzalloc(gpio_bank_count * sizeof(struct gpio_bank),
> > +                               GFP_KERNEL);
> 
> This is the real issue with the gpio_bank_count.
> 
> You are creating a global driver information related to all instances of
> this device with a per device variable.
> You should store the registers per device, and that will remove the need
> for that global information.

Agreed. But "gpio_bank" can be removed only during cleanup, as this
information is spread around the whole driver and the current
gpio driver assumes it to be an array of all instances of the
device.

For now, would modify the code to get gpio_bank_count using
omap_hwmod_class() iteration count.

Until code cleanup is done, 'gpio_bank_count' would be given to driver
by means of a global variable/ a function pointer to omap_get_gpio_count().

> 
> Benoit
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux