mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
PCI: cpcihp: Remove unused .get_power() and .set_power()
The .get_power() and .set_power() function pointers in struct cpci_hp_controller_ops were declared but never implemented by any driver. Thus, to improve code readability and reduce resource usage, remove these pointers and the code that has never been used. Link: https://lore.kernel.org/r/20250217185638.398925-1-trintaeoitogc@gmail.com Signed-off-by: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
This commit is contained in:
parent
588021b286
commit
8ff4574cf7
2 changed files with 2 additions and 17 deletions
|
@ -44,8 +44,6 @@ struct cpci_hp_controller_ops {
|
||||||
int (*enable_irq)(void);
|
int (*enable_irq)(void);
|
||||||
int (*disable_irq)(void);
|
int (*disable_irq)(void);
|
||||||
int (*check_irq)(void *dev_id);
|
int (*check_irq)(void *dev_id);
|
||||||
u8 (*get_power)(struct slot *slot);
|
|
||||||
int (*set_power)(struct slot *slot, int value);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cpci_hp_controller {
|
struct cpci_hp_controller {
|
||||||
|
|
|
@ -71,13 +71,10 @@ static int
|
||||||
enable_slot(struct hotplug_slot *hotplug_slot)
|
enable_slot(struct hotplug_slot *hotplug_slot)
|
||||||
{
|
{
|
||||||
struct slot *slot = to_slot(hotplug_slot);
|
struct slot *slot = to_slot(hotplug_slot);
|
||||||
int retval = 0;
|
|
||||||
|
|
||||||
dbg("%s - physical_slot = %s", __func__, slot_name(slot));
|
dbg("%s - physical_slot = %s", __func__, slot_name(slot));
|
||||||
|
|
||||||
if (controller->ops->set_power)
|
return 0;
|
||||||
retval = controller->ops->set_power(slot, 1);
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -109,12 +106,6 @@ disable_slot(struct hotplug_slot *hotplug_slot)
|
||||||
}
|
}
|
||||||
cpci_led_on(slot);
|
cpci_led_on(slot);
|
||||||
|
|
||||||
if (controller->ops->set_power) {
|
|
||||||
retval = controller->ops->set_power(slot, 0);
|
|
||||||
if (retval)
|
|
||||||
goto disable_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
slot->adapter_status = 0;
|
slot->adapter_status = 0;
|
||||||
|
|
||||||
if (slot->extracting) {
|
if (slot->extracting) {
|
||||||
|
@ -129,11 +120,7 @@ disable_error:
|
||||||
static u8
|
static u8
|
||||||
cpci_get_power_status(struct slot *slot)
|
cpci_get_power_status(struct slot *slot)
|
||||||
{
|
{
|
||||||
u8 power = 1;
|
return 1;
|
||||||
|
|
||||||
if (controller->ops->get_power)
|
|
||||||
power = controller->ops->get_power(slot);
|
|
||||||
return power;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Add table
Reference in a new issue