mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
s390/pci: remove clp_rescan_pci_devices_simple()
clp_rescan_pci_devices_simple() is neither simpler than clp_scan_pci_devices() nor does it really scan PCI devices, in particular it will neither add newly discovered devices nor remove those which disappeared. Instead it only refreshes PCI function handles and also has just a single callsite in the same translation unit left which in fact only refreshes one specific function handle identified by a FID. Clarify this by renaming the function and its helper to clp_refresh_fh() respectvely __clp_refresh_fh() and make it take a fid directly which saves us dealing with the NULL case which updated all function handles but is not used anymore. Furthermore since the only callsite is in the same translation unit make it static. Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
parent
809fcfaf92
commit
c3b2c9064e
2 changed files with 21 additions and 24 deletions
|
@ -210,7 +210,6 @@ void zpci_remove_reserved_devices(void);
|
|||
/* CLP */
|
||||
int clp_setup_writeback_mio(void);
|
||||
int clp_scan_pci_devices(void);
|
||||
int clp_rescan_pci_devices_simple(u32 *fid);
|
||||
int clp_add_pci_device(u32, u32, int);
|
||||
int clp_enable_fh(struct zpci_dev *, u8);
|
||||
int clp_disable_fh(struct zpci_dev *);
|
||||
|
|
|
@ -244,6 +244,7 @@ int clp_add_pci_device(u32 fid, u32 fh, int configured)
|
|||
return rc;
|
||||
}
|
||||
|
||||
static int clp_refresh_fh(u32 fid);
|
||||
/*
|
||||
* Enable/Disable a given PCI function and update its function handle if
|
||||
* necessary
|
||||
|
@ -286,7 +287,7 @@ static int clp_set_pci_fn(struct zpci_dev *zdev, u8 nr_dma_as, u8 command)
|
|||
} else if (!rc && rrb->response.hdr.rsp == CLP_RC_SETPCIFN_ALRDY &&
|
||||
rrb->response.fh == 0) {
|
||||
/* Function is already in desired state - update handle */
|
||||
rc = clp_rescan_pci_devices_simple(&fid);
|
||||
rc = clp_refresh_fh(fid);
|
||||
}
|
||||
clp_free_block(rrb);
|
||||
return rc;
|
||||
|
@ -408,24 +409,6 @@ static void __clp_add(struct clp_fh_list_entry *entry, void *data)
|
|||
clp_add_pci_device(entry->fid, entry->fh, entry->config_state);
|
||||
}
|
||||
|
||||
static void __clp_update(struct clp_fh_list_entry *entry, void *data)
|
||||
{
|
||||
struct zpci_dev *zdev;
|
||||
u32 *fid = data;
|
||||
|
||||
if (!entry->vendor_id)
|
||||
return;
|
||||
|
||||
if (fid && *fid != entry->fid)
|
||||
return;
|
||||
|
||||
zdev = get_zdev_by_fid(entry->fid);
|
||||
if (!zdev)
|
||||
return;
|
||||
|
||||
zdev->fh = entry->fh;
|
||||
}
|
||||
|
||||
int clp_scan_pci_devices(void)
|
||||
{
|
||||
struct clp_req_rsp_list_pci *rrb;
|
||||
|
@ -441,10 +424,25 @@ int clp_scan_pci_devices(void)
|
|||
return rc;
|
||||
}
|
||||
|
||||
/* Rescan PCI functions and refresh function handles. If fid is non-NULL only
|
||||
* refresh the handle of the function matching @fid
|
||||
static void __clp_refresh_fh(struct clp_fh_list_entry *entry, void *data)
|
||||
{
|
||||
struct zpci_dev *zdev;
|
||||
u32 fid = *((u32 *)data);
|
||||
|
||||
if (!entry->vendor_id || fid != entry->fid)
|
||||
return;
|
||||
|
||||
zdev = get_zdev_by_fid(fid);
|
||||
if (!zdev)
|
||||
return;
|
||||
|
||||
zdev->fh = entry->fh;
|
||||
}
|
||||
|
||||
/*
|
||||
* Refresh the function handle of the function matching @fid
|
||||
*/
|
||||
int clp_rescan_pci_devices_simple(u32 *fid)
|
||||
static int clp_refresh_fh(u32 fid)
|
||||
{
|
||||
struct clp_req_rsp_list_pci *rrb;
|
||||
int rc;
|
||||
|
@ -453,7 +451,7 @@ int clp_rescan_pci_devices_simple(u32 *fid)
|
|||
if (!rrb)
|
||||
return -ENOMEM;
|
||||
|
||||
rc = clp_list_pci(rrb, fid, __clp_update);
|
||||
rc = clp_list_pci(rrb, &fid, __clp_refresh_fh);
|
||||
|
||||
clp_free_block(rrb);
|
||||
return rc;
|
||||
|
|
Loading…
Reference in a new issue