diff options
Diffstat (limited to 'drivers/w1')
-rw-r--r-- | drivers/w1/masters/w1-gpio.c | 6 | ||||
-rw-r--r-- | drivers/w1/w1.c | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c index d39dfa4cc235..46d97014342e 100644 --- a/drivers/w1/masters/w1-gpio.c +++ b/drivers/w1/masters/w1-gpio.c | |||
@@ -47,11 +47,13 @@ static u8 w1_gpio_read_bit(void *data) | |||
47 | return gpio_get_value(pdata->pin) ? 1 : 0; | 47 | return gpio_get_value(pdata->pin) ? 1 : 0; |
48 | } | 48 | } |
49 | 49 | ||
50 | #if defined(CONFIG_OF) | ||
50 | static struct of_device_id w1_gpio_dt_ids[] = { | 51 | static struct of_device_id w1_gpio_dt_ids[] = { |
51 | { .compatible = "w1-gpio" }, | 52 | { .compatible = "w1-gpio" }, |
52 | {} | 53 | {} |
53 | }; | 54 | }; |
54 | MODULE_DEVICE_TABLE(of, w1_gpio_dt_ids); | 55 | MODULE_DEVICE_TABLE(of, w1_gpio_dt_ids); |
56 | #endif | ||
55 | 57 | ||
56 | static int w1_gpio_probe_dt(struct platform_device *pdev) | 58 | static int w1_gpio_probe_dt(struct platform_device *pdev) |
57 | { | 59 | { |
@@ -158,7 +160,7 @@ static int w1_gpio_probe(struct platform_device *pdev) | |||
158 | return err; | 160 | return err; |
159 | } | 161 | } |
160 | 162 | ||
161 | static int __exit w1_gpio_remove(struct platform_device *pdev) | 163 | static int w1_gpio_remove(struct platform_device *pdev) |
162 | { | 164 | { |
163 | struct w1_bus_master *master = platform_get_drvdata(pdev); | 165 | struct w1_bus_master *master = platform_get_drvdata(pdev); |
164 | struct w1_gpio_platform_data *pdata = pdev->dev.platform_data; | 166 | struct w1_gpio_platform_data *pdata = pdev->dev.platform_data; |
@@ -210,7 +212,7 @@ static struct platform_driver w1_gpio_driver = { | |||
210 | .of_match_table = of_match_ptr(w1_gpio_dt_ids), | 212 | .of_match_table = of_match_ptr(w1_gpio_dt_ids), |
211 | }, | 213 | }, |
212 | .probe = w1_gpio_probe, | 214 | .probe = w1_gpio_probe, |
213 | .remove = __exit_p(w1_gpio_remove), | 215 | .remove = w1_gpio_remove, |
214 | .suspend = w1_gpio_suspend, | 216 | .suspend = w1_gpio_suspend, |
215 | .resume = w1_gpio_resume, | 217 | .resume = w1_gpio_resume, |
216 | }; | 218 | }; |
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 7994d933f040..7ce277d2bb67 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c | |||
@@ -924,7 +924,8 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb | |||
924 | tmp64 = (triplet_ret >> 2); | 924 | tmp64 = (triplet_ret >> 2); |
925 | rn |= (tmp64 << i); | 925 | rn |= (tmp64 << i); |
926 | 926 | ||
927 | if (kthread_should_stop()) { | 927 | /* ensure we're called from kthread and not by netlink callback */ |
928 | if (!dev->priv && kthread_should_stop()) { | ||
928 | mutex_unlock(&dev->bus_mutex); | 929 | mutex_unlock(&dev->bus_mutex); |
929 | dev_dbg(&dev->dev, "Abort w1_search\n"); | 930 | dev_dbg(&dev->dev, "Abort w1_search\n"); |
930 | return; | 931 | return; |