Re: [RESEND PATCH] PCI: cpci: remove unused fields

Guilherme Giacomo Simoes
2025-02-15T02:06:46Z

Bjorn Helgaas <helgaas@kernel.org> wrote:
> There are no implementations of ->set_power() or ->get_power(), are
> there? If not, we can just remove them and the calls to them.
>
> I don't see why we should add SLOT_ENABLED.
Are not implementations of set_power() and get_power().
I removed this funcions and in enable_slot(), disable_slot() and
cpci_get_power_status() I use a `flags` field that I create in
cpci_hp_controller_ops struct. I created this `flags` for store a power_status
and use this in enable_slot(), disable_slot() and cpci_get_power_status() that
before uses a set_power() and get_power(). I do this way, because I seeing this
patter in another pci subsystems. In adittion on this, the flags can be used
for store anothers values.

But the Christophe JAILLET <christophe.jaillet@wanadoo.fr> say:
"If neither get_power nor set_power where defined in any driver, then
cpci_get_power_status() was always returning 1.
IIUC, now it may return 1 or 0 depending of if enable_slot() or
disable_slot() have been called."

Do you think that is better we only return 1 in pci_get_power_status() and
remove SLOT_ENABLED and `flags` field?

Thanks,
Guilherme