diff options
Diffstat (limited to 'drivers/net/phy/mdio-gpio.c')
-rw-r--r-- | drivers/net/phy/mdio-gpio.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c index 49ce7ece5af3..c9cb486c753d 100644 --- a/drivers/net/phy/mdio-gpio.c +++ b/drivers/net/phy/mdio-gpio.c | |||
@@ -80,7 +80,8 @@ static void mdio_dir(struct mdiobb_ctrl *ctrl, int dir) | |||
80 | * assume the pin serves as pull-up. If direction is | 80 | * assume the pin serves as pull-up. If direction is |
81 | * output, the default value is high. | 81 | * output, the default value is high. |
82 | */ | 82 | */ |
83 | gpio_set_value(bitbang->mdo, 1 ^ bitbang->mdo_active_low); | 83 | gpio_set_value_cansleep(bitbang->mdo, |
84 | 1 ^ bitbang->mdo_active_low); | ||
84 | return; | 85 | return; |
85 | } | 86 | } |
86 | 87 | ||
@@ -96,7 +97,8 @@ static int mdio_get(struct mdiobb_ctrl *ctrl) | |||
96 | struct mdio_gpio_info *bitbang = | 97 | struct mdio_gpio_info *bitbang = |
97 | container_of(ctrl, struct mdio_gpio_info, ctrl); | 98 | container_of(ctrl, struct mdio_gpio_info, ctrl); |
98 | 99 | ||
99 | return gpio_get_value(bitbang->mdio) ^ bitbang->mdio_active_low; | 100 | return gpio_get_value_cansleep(bitbang->mdio) ^ |
101 | bitbang->mdio_active_low; | ||
100 | } | 102 | } |
101 | 103 | ||
102 | static void mdio_set(struct mdiobb_ctrl *ctrl, int what) | 104 | static void mdio_set(struct mdiobb_ctrl *ctrl, int what) |
@@ -105,9 +107,11 @@ static void mdio_set(struct mdiobb_ctrl *ctrl, int what) | |||
105 | container_of(ctrl, struct mdio_gpio_info, ctrl); | 107 | container_of(ctrl, struct mdio_gpio_info, ctrl); |
106 | 108 | ||
107 | if (bitbang->mdo) | 109 | if (bitbang->mdo) |
108 | gpio_set_value(bitbang->mdo, what ^ bitbang->mdo_active_low); | 110 | gpio_set_value_cansleep(bitbang->mdo, |
111 | what ^ bitbang->mdo_active_low); | ||
109 | else | 112 | else |
110 | gpio_set_value(bitbang->mdio, what ^ bitbang->mdio_active_low); | 113 | gpio_set_value_cansleep(bitbang->mdio, |
114 | what ^ bitbang->mdio_active_low); | ||
111 | } | 115 | } |
112 | 116 | ||
113 | static void mdc_set(struct mdiobb_ctrl *ctrl, int what) | 117 | static void mdc_set(struct mdiobb_ctrl *ctrl, int what) |
@@ -115,7 +119,7 @@ static void mdc_set(struct mdiobb_ctrl *ctrl, int what) | |||
115 | struct mdio_gpio_info *bitbang = | 119 | struct mdio_gpio_info *bitbang = |
116 | container_of(ctrl, struct mdio_gpio_info, ctrl); | 120 | container_of(ctrl, struct mdio_gpio_info, ctrl); |
117 | 121 | ||
118 | gpio_set_value(bitbang->mdc, what ^ bitbang->mdc_active_low); | 122 | gpio_set_value_cansleep(bitbang->mdc, what ^ bitbang->mdc_active_low); |
119 | } | 123 | } |
120 | 124 | ||
121 | static struct mdiobb_ops mdio_gpio_ops = { | 125 | static struct mdiobb_ops mdio_gpio_ops = { |