diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-06-22 05:32:41 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-06-22 05:32:41 -0400 |
commit | 57fa8a1e22c5833fb2cae96af68fc39ec21cb017 (patch) | |
tree | b0bb4e4a6e04a24119da30253add9fe9ffbc8d22 /drivers/net/xen-netback/xenbus.c | |
parent | f267f9dff8ba00a8b11f340da3634858ad50ebab (diff) | |
parent | c99d49a8f81fb35e67b0ffa45f320a75e0b5639d (diff) |
Merge tag 'asoc-v4.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Further updates for v4.2
There's a bunch of additional updates and fixes that came in since my
orignal pull request here, including DT support for rt5645 and fairly
large serieses of cleanups and improvements to tas2552 and rcar.
Diffstat (limited to 'drivers/net/xen-netback/xenbus.c')
-rw-r--r-- | drivers/net/xen-netback/xenbus.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index fee02414529e..968787abf78d 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
@@ -34,6 +34,8 @@ struct backend_info { | |||
34 | enum xenbus_state frontend_state; | 34 | enum xenbus_state frontend_state; |
35 | struct xenbus_watch hotplug_status_watch; | 35 | struct xenbus_watch hotplug_status_watch; |
36 | u8 have_hotplug_status_watch:1; | 36 | u8 have_hotplug_status_watch:1; |
37 | |||
38 | const char *hotplug_script; | ||
37 | }; | 39 | }; |
38 | 40 | ||
39 | static int connect_rings(struct backend_info *be, struct xenvif_queue *queue); | 41 | static int connect_rings(struct backend_info *be, struct xenvif_queue *queue); |
@@ -238,6 +240,7 @@ static int netback_remove(struct xenbus_device *dev) | |||
238 | xenvif_free(be->vif); | 240 | xenvif_free(be->vif); |
239 | be->vif = NULL; | 241 | be->vif = NULL; |
240 | } | 242 | } |
243 | kfree(be->hotplug_script); | ||
241 | kfree(be); | 244 | kfree(be); |
242 | dev_set_drvdata(&dev->dev, NULL); | 245 | dev_set_drvdata(&dev->dev, NULL); |
243 | return 0; | 246 | return 0; |
@@ -255,6 +258,7 @@ static int netback_probe(struct xenbus_device *dev, | |||
255 | struct xenbus_transaction xbt; | 258 | struct xenbus_transaction xbt; |
256 | int err; | 259 | int err; |
257 | int sg; | 260 | int sg; |
261 | const char *script; | ||
258 | struct backend_info *be = kzalloc(sizeof(struct backend_info), | 262 | struct backend_info *be = kzalloc(sizeof(struct backend_info), |
259 | GFP_KERNEL); | 263 | GFP_KERNEL); |
260 | if (!be) { | 264 | if (!be) { |
@@ -347,6 +351,15 @@ static int netback_probe(struct xenbus_device *dev, | |||
347 | if (err) | 351 | if (err) |
348 | pr_debug("Error writing multi-queue-max-queues\n"); | 352 | pr_debug("Error writing multi-queue-max-queues\n"); |
349 | 353 | ||
354 | script = xenbus_read(XBT_NIL, dev->nodename, "script", NULL); | ||
355 | if (IS_ERR(script)) { | ||
356 | err = PTR_ERR(script); | ||
357 | xenbus_dev_fatal(dev, err, "reading script"); | ||
358 | goto fail; | ||
359 | } | ||
360 | |||
361 | be->hotplug_script = script; | ||
362 | |||
350 | err = xenbus_switch_state(dev, XenbusStateInitWait); | 363 | err = xenbus_switch_state(dev, XenbusStateInitWait); |
351 | if (err) | 364 | if (err) |
352 | goto fail; | 365 | goto fail; |
@@ -379,22 +392,14 @@ static int netback_uevent(struct xenbus_device *xdev, | |||
379 | struct kobj_uevent_env *env) | 392 | struct kobj_uevent_env *env) |
380 | { | 393 | { |
381 | struct backend_info *be = dev_get_drvdata(&xdev->dev); | 394 | struct backend_info *be = dev_get_drvdata(&xdev->dev); |
382 | char *val; | ||
383 | 395 | ||
384 | val = xenbus_read(XBT_NIL, xdev->nodename, "script", NULL); | 396 | if (!be) |
385 | if (IS_ERR(val)) { | 397 | return 0; |
386 | int err = PTR_ERR(val); | 398 | |
387 | xenbus_dev_fatal(xdev, err, "reading script"); | 399 | if (add_uevent_var(env, "script=%s", be->hotplug_script)) |
388 | return err; | 400 | return -ENOMEM; |
389 | } else { | ||
390 | if (add_uevent_var(env, "script=%s", val)) { | ||
391 | kfree(val); | ||
392 | return -ENOMEM; | ||
393 | } | ||
394 | kfree(val); | ||
395 | } | ||
396 | 401 | ||
397 | if (!be || !be->vif) | 402 | if (!be->vif) |
398 | return 0; | 403 | return 0; |
399 | 404 | ||
400 | return add_uevent_var(env, "vif=%s", be->vif->dev->name); | 405 | return add_uevent_var(env, "vif=%s", be->vif->dev->name); |