Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e363159 authored by Kenji Kaneshige's avatar Kenji Kaneshige Committed by Jesse Barnes
Browse files

PCI: pciehp: remove hp_slot field



The hp_slot field is to identify the slot under the same
controller. But, since PCIe downstream port has only one slot at most,
it is meaningless and we don't need it.

Acked-by: default avatarAlex Chiang <achiang@hp.com>
Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent d689f7eb
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -73,7 +73,6 @@ do { \
#define SLOT_NAME_SIZE 10
#define SLOT_NAME_SIZE 10
struct slot {
struct slot {
	u8 state;
	u8 state;
	u8 hp_slot;
	u32 number;
	u32 number;
	struct controller *ctrl;
	struct controller *ctrl;
	struct hpc_ops *hpc_ops;
	struct hpc_ops *hpc_ops;
+2 −2
Original line number Original line Diff line number Diff line
@@ -124,10 +124,10 @@ static int init_slot(struct controller *ctrl)
	snprintf(name, SLOT_NAME_SIZE, "%u", slot->number);
	snprintf(name, SLOT_NAME_SIZE, "%u", slot->number);


	ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:00 "
	ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:00 "
		 "hp_slot=%x sun=%x slot_device_offset=%x\n",
		 "sun=%x slot_device_offset=%x\n",
		 pci_domain_nr(ctrl->pci_dev->subordinate),
		 pci_domain_nr(ctrl->pci_dev->subordinate),
		 ctrl->pci_dev->subordinate->number,
		 ctrl->pci_dev->subordinate->number,
		 slot->hp_slot, slot->number, ctrl->slot_device_offset);
		 slot->number, ctrl->slot_device_offset);
	retval = pci_hp_register(hotplug,
	retval = pci_hp_register(hotplug,
				 ctrl->pci_dev->subordinate, 0, name);
				 ctrl->pci_dev->subordinate, 0, name);
	if (retval) {
	if (retval) {
+2 −4
Original line number Original line Diff line number Diff line
@@ -210,8 +210,8 @@ static int board_added(struct slot *p_slot)
	struct controller *ctrl = p_slot->ctrl;
	struct controller *ctrl = p_slot->ctrl;
	struct pci_bus *parent = ctrl->pci_dev->subordinate;
	struct pci_bus *parent = ctrl->pci_dev->subordinate;


	ctrl_dbg(ctrl, "%s: slot device, slot offset, hp slot = 0, %d, %d\n",
	ctrl_dbg(ctrl, "%s: slot device, slot offset = 0, %d\n",
		 __func__, ctrl->slot_device_offset, p_slot->hp_slot);
		 __func__, ctrl->slot_device_offset);


	if (POWER_CTRL(ctrl)) {
	if (POWER_CTRL(ctrl)) {
		/* Power on slot */
		/* Power on slot */
@@ -268,8 +268,6 @@ static int remove_board(struct slot *p_slot)
	if (retval)
	if (retval)
		return retval;
		return retval;


	ctrl_dbg(ctrl, "%s: hp_slot = %d\n", __func__, p_slot->hp_slot);

	if (POWER_CTRL(ctrl)) {
	if (POWER_CTRL(ctrl)) {
		/* power off slot */
		/* power off slot */
		retval = p_slot->hpc_ops->power_off_slot(p_slot);
		retval = p_slot->hpc_ops->power_off_slot(p_slot);
+0 −5
Original line number Original line Diff line number Diff line
@@ -497,8 +497,6 @@ static int hpc_power_on_slot(struct slot * slot)
	u16 slot_status;
	u16 slot_status;
	int retval = 0;
	int retval = 0;


	ctrl_dbg(ctrl, "%s: slot->hp_slot %x\n", __func__, slot->hp_slot);

	/* Clear sticky power-fault bit from previous power failures */
	/* Clear sticky power-fault bit from previous power failures */
	retval = pciehp_readw(ctrl, PCI_EXP_SLTSTA, &slot_status);
	retval = pciehp_readw(ctrl, PCI_EXP_SLTSTA, &slot_status);
	if (retval) {
	if (retval) {
@@ -578,8 +576,6 @@ static int hpc_power_off_slot(struct slot * slot)
	int retval = 0;
	int retval = 0;
	int changed;
	int changed;


	ctrl_dbg(ctrl, "%s: slot->hp_slot %x\n", __func__, slot->hp_slot);

	/*
	/*
	 * Set Bad DLLP Mask bit in Correctable Error Mask
	 * Set Bad DLLP Mask bit in Correctable Error Mask
	 * Register. This is the workaround against Bad DLLP error
	 * Register. This is the workaround against Bad DLLP error
@@ -928,7 +924,6 @@ static int pcie_init_slot(struct controller *ctrl)
	if (!slot)
	if (!slot)
		return -ENOMEM;
		return -ENOMEM;


	slot->hp_slot = 0;
	slot->ctrl = ctrl;
	slot->ctrl = ctrl;
	slot->hpc_ops = ctrl->hpc_ops;
	slot->hpc_ops = ctrl->hpc_ops;
	slot->number = ctrl->first_slot;
	slot->number = ctrl->first_slot;