[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250217185638.398925-1-trintaeoitogc@gmail.com>
Date: Mon, 17 Feb 2025 15:56:38 -0300
From: Guilherme Giacomo Simoes <trintaeoitogc@...il.com>
To: christophe.jaillet@...adoo.fr,
bhelgaas@...gle.com,
scott@...teful.org
Cc: linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org,
Guilherme Giacomo Simoes <trintaeoitogc@...il.com>
Subject: [PATCH V2] PCI: cpci: remove unused fields
The `get_power()` and `set_power()` function pointers in the
`cpci_hp_controller ops` struct were declared but never implemented by
any driver. To improve code readability and reduce resource usage,
remove this pointers.
Signed-off-by: Guilherme Giacomo Simoes <trintaeoitogc@...il.com>
---
v2 changes
- Remove uneccessary SLOT_ENABLE constant
- Remove uneccessary flags fields
---
drivers/pci/hotplug/cpci_hotplug.h | 2 --
drivers/pci/hotplug/cpci_hotplug_core.c | 17 ++---------------
2 files changed, 2 insertions(+), 17 deletions(-)
diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h
index 03fa39ab0c88..a31d6b62f523 100644
--- a/drivers/pci/hotplug/cpci_hotplug.h
+++ b/drivers/pci/hotplug/cpci_hotplug.h
@@ -44,8 +44,6 @@ struct cpci_hp_controller_ops {
int (*enable_irq)(void);
int (*disable_irq)(void);
int (*check_irq)(void *dev_id);
- u8 (*get_power)(struct slot *slot);
- int (*set_power)(struct slot *slot, int value);
};
struct cpci_hp_controller {
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index d0559d2faf50..dd93e53ea7c2 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -71,13 +71,10 @@ static int
enable_slot(struct hotplug_slot *hotplug_slot)
{
struct slot *slot = to_slot(hotplug_slot);
- int retval = 0;
dbg("%s - physical_slot = %s", __func__, slot_name(slot));
- if (controller->ops->set_power)
- retval = controller->ops->set_power(slot, 1);
- return retval;
+ return 0;
}
static int
@@ -109,12 +106,6 @@ disable_slot(struct hotplug_slot *hotplug_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;
if (slot->extracting) {
@@ -129,11 +120,7 @@ disable_slot(struct hotplug_slot *hotplug_slot)
static u8
cpci_get_power_status(struct slot *slot)
{
- u8 power = 1;
-
- if (controller->ops->get_power)
- power = controller->ops->get_power(slot);
- return power;
+ return 1;
}
static int
--
2.34.1
Powered by blists - more mailing lists