Yet more OCP cleanup (1/N)
ocp_setup_dev() used ocp_get_paddr() et al to lookup the core_ocp table, when it already has and index to the right entry in that table. This patch makes it use the entry directly. This removes the last user of ocp_get_irq(), so it is removed also.
drivers/ocp/ocp-probe.c +3 -3
@@ -106,9 +106,9 @@ dev->vendor = core_ocp[index].vendor; dev->device = core_ocp[index].device; dev->num =ocp_get_num (dev->device); - dev->paddr = (phys_addr_t )ocp_get_paddr (dev->device,dev->num); - dev->irq =ocp_get_irq (dev->device,dev->num); - dev->pm =ocp_get_pm (dev->device,dev->num); + dev->paddr = core_ocp[index].paddr; + dev->irq = core_ocp[index].irq; + dev->pm = core_ocp[index].pm; dev->current_state =4 ;sprintf (dev->slot_name,"%02x:%02x.%d" , dev->bus->number, dev->device, dev->num);
drivers/ocp/ocp.c +0 -25
@@ -166,30 +166,6 @@ }/** -* ocp_get_irq - get irq for ocp device and instance of it -* @device: OCP device such as PCI, GPT, UART, OPB, IIC, GPIO, EMAC, ZMII, -* @dev_num: ocp device number whos IRQ -* value you want -* -* The routine returns the power management value or OCP_CPM_NA, -* of device and instance requested -*/ -int -ocp_get_irq (unsigned int device,int dev_num) -{ -int a, i; - -for (i =0 , a =0 ; core_ocp[i].device !=OCP_FUNC_INVALID ; i++) { -if (device == core_ocp[i].device) { -if (a == dev_num) -return (core_ocp[i].irq); - a++; - } - } -return OCP_IRQ_NA ; -} - -/** * ocp_get_paddr - get phyical address for ocp device and instance of it * @device: OCP device such as PCI, GPT, UART, OPB, IIC, GPIO, EMAC, ZMII * @dev_num: ocp device number whos paddr you want
@@ -277,7 +253,6 @@ }EXPORT_SYMBOL (ocp_get_pm); -EXPORT_SYMBOL (ocp_get_irq);EXPORT_SYMBOL (ocp_get_paddr);EXPORT_SYMBOL (ocp_get_max);EXPORT_SYMBOL (ocp_get_dev);
include/linux/ocp.h +0 -1
@@ -243,7 +243,6 @@extern struct ocp_device *ocp_get_dev (unsigned int device,int index);extern unsigned long ocp_get_paddr (unsigned int device,int dev_num);extern unsigned int ocp_get_max (unsigned int device); -extern int ocp_get_irq (unsigned int device,int dev_num);extern int ocp_get_pm (unsigned int device,int dev_num);extern unsigned int ocp_get_num (unsigned int device);extern unsigned ocp_get_bus_start (unsigned int device,int bus_num);
--
David Gibson | For every complex problem there is a
[email protected] | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/