lkml.org 
[lkml]   [2012]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Xen-devel] [PATCH 2/2] hvc_xen: implement multiconsole support
> +static int xencons_remove(struct xenbus_device *dev)
> +{
> + struct xencons_info *info = dev_get_drvdata(&dev->dev);
> +
> + spin_lock(&xencons_lock);
> + list_del(&info->list);
> + spin_unlock(&xencons_lock);
> + xencons_free(info);
> return 0;
> }
.. snip..
> static void __exit xen_hvc_fini(void)
> {
> - if (hvc)
> - hvc_remove(hvc);
> + struct xencons_info *entry, *next;
> +
> + if (list_empty(&xenconsoles))
> + return;
> +
> + spin_lock(&xencons_lock);

You take a lock.
> + list_for_each_entry_safe(entry, next, &xenconsoles, list) {
> + list_del(&entry->list);
> + if (entry->xbdev)
> + xencons_remove(entry->xbdev);

And then call xencons_remove which also takes the same lock.
> + else {
> + if (entry->irq > 0)
> + unbind_from_irqhandler(entry->irq, NULL);
> + if (entry->hvc);
> + hvc_remove(entry->hvc);
> + kfree(entry);
> + }
> + }
> + spin_unlock(&xencons_lock);


\
 
 \ /
  Last update: 2012-01-27 19:39    [W:0.070 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site