lkml.org 
[lkml]   [2015]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v3 2/7] vfio: platform: add capability to register a reset function
    Date
    On Friday 23 October 2015 14:37:10 Eric Auger wrote:
    > +
    > +void vfio_platform_unregister_reset(const char *compat)
    > +{
    > + struct vfio_platform_reset_node *iter, *temp;
    > +
    > + mutex_lock(&driver_lock);
    > + list_for_each_entry_safe(iter, temp, &reset_list, link) {
    > + if (!strcmp(iter->compat, compat)) {
    > + list_del(&iter->link);
    > + break;
    > + }
    > + }
    > +
    > + mutex_unlock(&driver_lock);
    > +}
    > +EXPORT_SYMBOL_GPL(vfio_platform_unregister_reset);
    >

    This is slightly unsafe in case you ever get two drivers that register
    with the same compat string. If we care about that, we could pass
    and compare both the string and the function pointer, or the
    vfio_platform_reset_node.

    Arnd


    \
     
     \ /
      Last update: 2015-10-23 15:21    [W:4.027 / U:0.504 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site