From kristen.c.accardi@intel.com Thu Sep 28 15:51:48 2006 Date: Thu, 28 Sep 2006 15:51:36 -0700 From: Kristen Carlson Accardi To: greg@kroah.com, Kristen Accardi Cc: Kenji Kaneshige Subject: [patch 2/2] shpchp: remove unnecessary cmd_busy member from struct controller Message-Id: <20060928155136.b3695495.kristen.c.accardi@intel.com> From: Kenji Kaneshige This patch removes unnecessary cmd_busy member from struct controller. Read command status register instead of using cmd_busy. Signed-off-by: Kenji Kaneshige Signed-off-by: Kristen Carlson Accardi Signed-off-by: Greg Kroah-Hartman --- drivers/pci/hotplug/shpchp.h | 1 - drivers/pci/hotplug/shpchp_hpc.c | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) --- gregkh-2.6.orig/drivers/pci/hotplug/shpchp.h +++ gregkh-2.6/drivers/pci/hotplug/shpchp.h @@ -103,7 +103,6 @@ struct controller { u32 cap_offset; unsigned long mmio_base; unsigned long mmio_size; - volatile int cmd_busy; }; --- gregkh-2.6.orig/drivers/pci/hotplug/shpchp_hpc.c +++ gregkh-2.6/drivers/pci/hotplug/shpchp_hpc.c @@ -339,7 +339,7 @@ static inline int shpc_wait_cmd(struct c rc = shpc_poll_ctrl_busy(ctrl); else rc = wait_event_interruptible_timeout(ctrl->queue, - !ctrl->cmd_busy, timeout); + !is_ctrl_busy(ctrl), timeout); if (!rc && is_ctrl_busy(ctrl)) { retval = -EIO; err("Command not completed in 1000 msec\n"); @@ -347,7 +347,6 @@ static inline int shpc_wait_cmd(struct c retval = -EINTR; info("Command was interrupted by a signal\n"); } - ctrl->cmd_busy = 0; return retval; } @@ -378,7 +377,6 @@ static int shpc_write_cmd(struct slot *s /* To make sure the Controller Busy bit is 0 before we send out the * command. */ - slot->ctrl->cmd_busy = 1; shpc_writew(ctrl, CMD, temp_word); /* @@ -928,7 +926,6 @@ static irqreturn_t shpc_isr(int irq, voi serr_int &= ~SERR_INTR_RSVDZ_MASK; shpc_writel(ctrl, SERR_INTR_ENABLE, serr_int); - ctrl->cmd_busy = 0; wake_up_interruptible(&ctrl->queue); }