diff options
author | Mark Langsdorf <mark.langsdorf@calxeda.com> | 2013-05-30 16:17:30 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-06-06 17:05:23 -0400 |
commit | 439d7a358f93a52458527329939be9f97db1242a (patch) | |
tree | 3b0079402a011a1d568ab4046351a355052474ff /drivers/ata/libahci.c | |
parent | 0a86e1c857134efe2cdb31d74bc7ea21721db494 (diff) |
ahci: make ahci_transmit_led_message into a function pointer
Create a new ata_port_operations function pointer called
transmit_led_message and give it the default value of
ahci_transmit_led_message. This allows AHCI controllers with
non-standard LED interfaces to use the existing em_ interface.
Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/libahci.c')
-rw-r--r-- | drivers/ata/libahci.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 3797a7bba15d..64c3f1f41af1 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
@@ -173,6 +173,7 @@ struct ata_port_operations ahci_ops = { | |||
173 | .em_store = ahci_led_store, | 173 | .em_store = ahci_led_store, |
174 | .sw_activity_show = ahci_activity_show, | 174 | .sw_activity_show = ahci_activity_show, |
175 | .sw_activity_store = ahci_activity_store, | 175 | .sw_activity_store = ahci_activity_store, |
176 | .transmit_led_message = ahci_transmit_led_message, | ||
176 | #ifdef CONFIG_PM | 177 | #ifdef CONFIG_PM |
177 | .port_suspend = ahci_port_suspend, | 178 | .port_suspend = ahci_port_suspend, |
178 | .port_resume = ahci_port_resume, | 179 | .port_resume = ahci_port_resume, |
@@ -774,7 +775,7 @@ static void ahci_start_port(struct ata_port *ap) | |||
774 | 775 | ||
775 | /* EM Transmit bit maybe busy during init */ | 776 | /* EM Transmit bit maybe busy during init */ |
776 | for (i = 0; i < EM_MAX_RETRY; i++) { | 777 | for (i = 0; i < EM_MAX_RETRY; i++) { |
777 | rc = ahci_transmit_led_message(ap, | 778 | rc = ap->ops->transmit_led_message(ap, |
778 | emp->led_state, | 779 | emp->led_state, |
779 | 4); | 780 | 4); |
780 | if (rc == -EBUSY) | 781 | if (rc == -EBUSY) |
@@ -915,7 +916,7 @@ static void ahci_sw_activity_blink(unsigned long arg) | |||
915 | led_message |= (1 << 16); | 916 | led_message |= (1 << 16); |
916 | } | 917 | } |
917 | spin_unlock_irqrestore(ap->lock, flags); | 918 | spin_unlock_irqrestore(ap->lock, flags); |
918 | ahci_transmit_led_message(ap, led_message, 4); | 919 | ap->ops->transmit_led_message(ap, led_message, 4); |
919 | } | 920 | } |
920 | 921 | ||
921 | static void ahci_init_sw_activity(struct ata_link *link) | 922 | static void ahci_init_sw_activity(struct ata_link *link) |
@@ -1044,7 +1045,7 @@ static ssize_t ahci_led_store(struct ata_port *ap, const char *buf, | |||
1044 | if (emp->blink_policy) | 1045 | if (emp->blink_policy) |
1045 | state &= ~EM_MSG_LED_VALUE_ACTIVITY; | 1046 | state &= ~EM_MSG_LED_VALUE_ACTIVITY; |
1046 | 1047 | ||
1047 | return ahci_transmit_led_message(ap, state, size); | 1048 | return ap->ops->transmit_led_message(ap, state, size); |
1048 | } | 1049 | } |
1049 | 1050 | ||
1050 | static ssize_t ahci_activity_store(struct ata_device *dev, enum sw_activity val) | 1051 | static ssize_t ahci_activity_store(struct ata_device *dev, enum sw_activity val) |
@@ -1063,7 +1064,7 @@ static ssize_t ahci_activity_store(struct ata_device *dev, enum sw_activity val) | |||
1063 | /* set the LED to OFF */ | 1064 | /* set the LED to OFF */ |
1064 | port_led_state &= EM_MSG_LED_VALUE_OFF; | 1065 | port_led_state &= EM_MSG_LED_VALUE_OFF; |
1065 | port_led_state |= (ap->port_no | (link->pmp << 8)); | 1066 | port_led_state |= (ap->port_no | (link->pmp << 8)); |
1066 | ahci_transmit_led_message(ap, port_led_state, 4); | 1067 | ap->ops->transmit_led_message(ap, port_led_state, 4); |
1067 | } else { | 1068 | } else { |
1068 | link->flags |= ATA_LFLAG_SW_ACTIVITY; | 1069 | link->flags |= ATA_LFLAG_SW_ACTIVITY; |
1069 | if (val == BLINK_OFF) { | 1070 | if (val == BLINK_OFF) { |
@@ -1071,7 +1072,7 @@ static ssize_t ahci_activity_store(struct ata_device *dev, enum sw_activity val) | |||
1071 | port_led_state &= EM_MSG_LED_VALUE_OFF; | 1072 | port_led_state &= EM_MSG_LED_VALUE_OFF; |
1072 | port_led_state |= (ap->port_no | (link->pmp << 8)); | 1073 | port_led_state |= (ap->port_no | (link->pmp << 8)); |
1073 | port_led_state |= EM_MSG_LED_VALUE_ON; /* check this */ | 1074 | port_led_state |= EM_MSG_LED_VALUE_ON; /* check this */ |
1074 | ahci_transmit_led_message(ap, port_led_state, 4); | 1075 | ap->ops->transmit_led_message(ap, port_led_state, 4); |
1075 | } | 1076 | } |
1076 | } | 1077 | } |
1077 | emp->blink_policy = val; | 1078 | emp->blink_policy = val; |