• Vaishali Thakkar's avatar
    pcmcia: Use module_pcmcia_driver for scsi drivers · dc245cfa
    Vaishali Thakkar authored
    Use module_pcmcia_driver for drivers whose init and exit functions
    only register and unregister, respectively.
    
    A simplified version of the Coccinelle semantic patch that performs
    this transformation is as follows:
    
    @A@
    identifier f, x;
    @@
    -static f(...) { return pcmcia_register_driver(&x); }
    
    @b depends on a@
    identifier e, a.x;
    @@
    -static e(...) { pcmcia_unregister_driver(&x); }
    
    @c depends on a && b@
    identifier a.f;
    declarer name module_init;
    @@
    -module_init(f);
    
    @d depends on a && b && c@
    identifier b.e, a.x;
    declarer name module_exit;
    declarer name module_pcmcia_driver;
    @@
    -module_exit(e);
    +module_pcmcia_driver(x);
    Signed-off-by: default avatarVaishali Thakkar <vthakkar1994@gmail.com>
    Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
    Cc: Martin K. Petersen <martin.petersen@oracle.com>
    Cc: linux-scsi@vger.kernel.org
    [linux@dominikbrodowski.net:
     - updated commit message
     - drop change to fdomain which got removed in the meantime]
    Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
    dc245cfa
nsp_cs.c 44.8 KB