Skip to content

Commit

Permalink
PCI: aerdrv: cleanup inconsistent functions
Browse files Browse the repository at this point in the history
This cleanup solves some minor naming issues by removing unuseful
function aer_delete_rootport() and by renaming disable_root_aer()
to aer_disable_rootport().

- Inconsistent location of alloc & free:
   The struct rpc is allocated in aer_alloc_rpc() at aerdrv.c
   while it is implicitly freed in aer_delete_rootport() at
   aerdrv_core.c.

- Inconsistent function name:
   It makes a bit confusion that aer_delete_rootport() is seemed
   to be paired with aer_enable_rootport(), i.e. there is neither
   "add" against "delete" nor "disable" against "enable".

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Hidetoshi Seto authored and Jesse Barnes committed May 11, 2010
1 parent c6d34ed commit 460d298
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
3 changes: 2 additions & 1 deletion drivers/pci/pcie/aer/aerdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ static void aer_remove(struct pcie_device *dev)

wait_event(rpc->wait_release, rpc->prod_idx == rpc->cons_idx);

aer_delete_rootport(rpc);
aer_disable_rootport(rpc);
kfree(rpc);
set_service_data(dev, NULL);
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/pci/pcie/aer/aerdrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static inline pci_ers_result_t merge_result(enum pci_ers_result orig,

extern struct bus_type pcie_port_bus_type;
extern void aer_enable_rootport(struct aer_rpc *rpc);
extern void aer_delete_rootport(struct aer_rpc *rpc);
extern void aer_disable_rootport(struct aer_rpc *rpc);
extern int aer_init(struct pcie_device *dev);
extern void aer_isr(struct work_struct *work);
extern void aer_print_error(struct pci_dev *dev, struct aer_err_info *info);
Expand Down
18 changes: 2 additions & 16 deletions drivers/pci/pcie/aer/aerdrv_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,12 +629,12 @@ void aer_enable_rootport(struct aer_rpc *rpc)
}

/**
* disable_root_aer - disable Root Port's interrupts when receiving messages
* aer_disable_rootport - disable Root Port's interrupts when receiving messages
* @rpc: pointer to a Root Port data structure
*
* Invoked when PCIe bus unloads AER service driver.
*/
static void disable_root_aer(struct aer_rpc *rpc)
void aer_disable_rootport(struct aer_rpc *rpc)
{
struct pci_dev *pdev = rpc->rpd->port;
u32 reg32;
Expand Down Expand Up @@ -839,20 +839,6 @@ void aer_isr(struct work_struct *work)
wake_up(&rpc->wait_release);
}

/**
* aer_delete_rootport - disable root port aer and delete service data
* @rpc: pointer to a root port device being deleted
*
* Invoked when AER service unloaded on a specific Root Port
*/
void aer_delete_rootport(struct aer_rpc *rpc)
{
/* Disable root port AER itself */
disable_root_aer(rpc);

kfree(rpc);
}

/**
* aer_init - provide AER initialization
* @dev: pointer to AER pcie device
Expand Down

0 comments on commit 460d298

Please sign in to comment.