Skip to content

Commit dacf3ca

Browse files
Wang KefengRussell King (Oracle)
authored andcommitted
ARM: 9173/1: amba: kill amba_find_match()
There is no one use amba_find_match(), kill it. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
1 parent 25d490e commit dacf3ca

2 files changed

Lines changed: 0 additions & 62 deletions

File tree

drivers/amba/bus.c

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -669,66 +669,6 @@ void amba_device_unregister(struct amba_device *dev)
669669
device_unregister(&dev->dev);
670670
}
671671

672-
673-
struct find_data {
674-
struct amba_device *dev;
675-
struct device *parent;
676-
const char *busid;
677-
unsigned int id;
678-
unsigned int mask;
679-
};
680-
681-
static int amba_find_match(struct device *dev, void *data)
682-
{
683-
struct find_data *d = data;
684-
struct amba_device *pcdev = to_amba_device(dev);
685-
int r;
686-
687-
r = (pcdev->periphid & d->mask) == d->id;
688-
if (d->parent)
689-
r &= d->parent == dev->parent;
690-
if (d->busid)
691-
r &= strcmp(dev_name(dev), d->busid) == 0;
692-
693-
if (r) {
694-
get_device(dev);
695-
d->dev = pcdev;
696-
}
697-
698-
return r;
699-
}
700-
701-
/**
702-
* amba_find_device - locate an AMBA device given a bus id
703-
* @busid: bus id for device (or NULL)
704-
* @parent: parent device (or NULL)
705-
* @id: peripheral ID (or 0)
706-
* @mask: peripheral ID mask (or 0)
707-
*
708-
* Return the AMBA device corresponding to the supplied parameters.
709-
* If no device matches, returns NULL.
710-
*
711-
* NOTE: When a valid device is found, its refcount is
712-
* incremented, and must be decremented before the returned
713-
* reference.
714-
*/
715-
struct amba_device *
716-
amba_find_device(const char *busid, struct device *parent, unsigned int id,
717-
unsigned int mask)
718-
{
719-
struct find_data data;
720-
721-
data.dev = NULL;
722-
data.parent = parent;
723-
data.busid = busid;
724-
data.id = id;
725-
data.mask = mask;
726-
727-
bus_for_each_dev(&amba_bustype, NULL, &data, amba_find_match);
728-
729-
return data.dev;
730-
}
731-
732672
/**
733673
* amba_request_regions - request all mem regions associated with device
734674
* @dev: amba_device structure for device
@@ -768,6 +708,5 @@ EXPORT_SYMBOL(amba_driver_register);
768708
EXPORT_SYMBOL(amba_driver_unregister);
769709
EXPORT_SYMBOL(amba_device_register);
770710
EXPORT_SYMBOL(amba_device_unregister);
771-
EXPORT_SYMBOL(amba_find_device);
772711
EXPORT_SYMBOL(amba_request_regions);
773712
EXPORT_SYMBOL(amba_release_regions);

include/linux/amba/bus.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ void amba_device_put(struct amba_device *);
117117
int amba_device_add(struct amba_device *, struct resource *);
118118
int amba_device_register(struct amba_device *, struct resource *);
119119
void amba_device_unregister(struct amba_device *);
120-
struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int);
121120
int amba_request_regions(struct amba_device *, const char *);
122121
void amba_release_regions(struct amba_device *);
123122

0 commit comments

Comments
 (0)