aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parport
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-10-28 05:11:33 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-03 19:32:59 -0500
commit7b7a0a30c985145bf4474639d832c94cd63059fa (patch)
tree2c608c8f43e1a2a36332b03f4e4036ee7cb134f2 /drivers/parport
parent27c6db2655502978c670bd15a1639066ff13c78c (diff)
parport: fix coding style
The multi-line comments were not according to the kernel coding style. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/parport')
-rw-r--r--drivers/parport/share.c69
1 files changed, 44 insertions, 25 deletions
diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index d85e566548b1..840c73063a6a 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -207,8 +207,10 @@ static void detach_driver_chain(struct parport *port)
207/* Ask kmod for some lowlevel drivers. */ 207/* Ask kmod for some lowlevel drivers. */
208static void get_lowlevel_driver (void) 208static void get_lowlevel_driver (void)
209{ 209{
210 /* There is no actual module called this: you should set 210 /*
211 * up an alias for modutils. */ 211 * There is no actual module called this: you should set
212 * up an alias for modutils.
213 */
212 request_module ("parport_lowlevel"); 214 request_module ("parport_lowlevel");
213} 215}
214 216
@@ -728,11 +730,12 @@ parport_register_device(struct parport *port, const char *name,
728 } 730 }
729 } 731 }
730 732
731 /* We up our own module reference count, and that of the port 733 /*
732 on which a device is to be registered, to ensure that 734 * We up our own module reference count, and that of the port
733 neither of us gets unloaded while we sleep in (e.g.) 735 * on which a device is to be registered, to ensure that
734 kmalloc. 736 * neither of us gets unloaded while we sleep in (e.g.)
735 */ 737 * kmalloc.
738 */
736 if (!try_module_get(port->ops->owner)) { 739 if (!try_module_get(port->ops->owner)) {
737 return NULL; 740 return NULL;
738 } 741 }
@@ -783,9 +786,11 @@ parport_register_device(struct parport *port, const char *name,
783 } 786 }
784 787
785 tmp->next = port->physport->devices; 788 tmp->next = port->physport->devices;
786 wmb(); /* Make sure that tmp->next is written before it's 789 wmb(); /*
787 added to the list; see comments marked 'no locking 790 * Make sure that tmp->next is written before it's
788 required' */ 791 * added to the list; see comments marked 'no locking
792 * required'
793 */
789 if (port->physport->devices) 794 if (port->physport->devices)
790 port->physport->devices->prev = tmp; 795 port->physport->devices->prev = tmp;
791 port->physport->devices = tmp; 796 port->physport->devices = tmp;
@@ -1008,8 +1013,10 @@ void parport_unregister_device(struct pardevice *dev)
1008 1013
1009 spin_unlock(&port->pardevice_lock); 1014 spin_unlock(&port->pardevice_lock);
1010 1015
1011 /* Make sure we haven't left any pointers around in the wait 1016 /*
1012 * list. */ 1017 * Make sure we haven't left any pointers around in the wait
1018 * list.
1019 */
1013 spin_lock_irq(&port->waitlist_lock); 1020 spin_lock_irq(&port->waitlist_lock);
1014 if (dev->waitprev || dev->waitnext || port->waithead == dev) { 1021 if (dev->waitprev || dev->waitnext || port->waithead == dev) {
1015 if (dev->waitprev) 1022 if (dev->waitprev)
@@ -1131,8 +1138,10 @@ int parport_claim(struct pardevice *dev)
1131 goto blocked; 1138 goto blocked;
1132 1139
1133 if (port->cad != oldcad) { 1140 if (port->cad != oldcad) {
1134 /* I think we'll actually deadlock rather than 1141 /*
1135 get here, but just in case.. */ 1142 * I think we'll actually deadlock rather than
1143 * get here, but just in case..
1144 */
1136 printk(KERN_WARNING 1145 printk(KERN_WARNING
1137 "%s: %s released port when preempted!\n", 1146 "%s: %s released port when preempted!\n",
1138 port->name, oldcad->name); 1147 port->name, oldcad->name);
@@ -1185,9 +1194,11 @@ int parport_claim(struct pardevice *dev)
1185 return 0; 1194 return 0;
1186 1195
1187blocked: 1196blocked:
1188 /* If this is the first time we tried to claim the port, register an 1197 /*
1189 interest. This is only allowed for devices sleeping in 1198 * If this is the first time we tried to claim the port, register an
1190 parport_claim_or_block(), or those with a wakeup function. */ 1199 * interest. This is only allowed for devices sleeping in
1200 * parport_claim_or_block(), or those with a wakeup function.
1201 */
1191 1202
1192 /* The cad_lock is still held for writing here */ 1203 /* The cad_lock is still held for writing here */
1193 if (dev->waiting & 2 || dev->wakeup) { 1204 if (dev->waiting & 2 || dev->wakeup) {
@@ -1223,8 +1234,10 @@ int parport_claim_or_block(struct pardevice *dev)
1223{ 1234{
1224 int r; 1235 int r;
1225 1236
1226 /* Signal to parport_claim() that we can wait even without a 1237 /*
1227 wakeup function. */ 1238 * Signal to parport_claim() that we can wait even without a
1239 * wakeup function.
1240 */
1228 dev->waiting = 2; 1241 dev->waiting = 2;
1229 1242
1230 /* Try to claim the port. If this fails, we need to sleep. */ 1243 /* Try to claim the port. If this fails, we need to sleep. */
@@ -1242,8 +1255,10 @@ int parport_claim_or_block(struct pardevice *dev)
1242 * See also parport_release() 1255 * See also parport_release()
1243 */ 1256 */
1244 1257
1245 /* If dev->waiting is clear now, an interrupt 1258 /*
1246 gave us the port and we would deadlock if we slept. */ 1259 * If dev->waiting is clear now, an interrupt
1260 * gave us the port and we would deadlock if we slept.
1261 */
1247 if (dev->waiting) { 1262 if (dev->waiting) {
1248 wait_event_interruptible(dev->wait_q, 1263 wait_event_interruptible(dev->wait_q,
1249 !dev->waiting); 1264 !dev->waiting);
@@ -1316,8 +1331,10 @@ void parport_release(struct pardevice *dev)
1316 /* Save control registers */ 1331 /* Save control registers */
1317 port->ops->save_state(port, dev->state); 1332 port->ops->save_state(port, dev->state);
1318 1333
1319 /* If anybody is waiting, find out who's been there longest and 1334 /*
1320 then wake them up. (Note: no locking required) */ 1335 * If anybody is waiting, find out who's been there longest and
1336 * then wake them up. (Note: no locking required)
1337 */
1321 /* !!! LOCKING IS NEEDED HERE */ 1338 /* !!! LOCKING IS NEEDED HERE */
1322 for (pd = port->waithead; pd; pd = pd->waitnext) { 1339 for (pd = port->waithead; pd; pd = pd->waitnext) {
1323 if (pd->waiting & 2) { /* sleeping in claim_or_block */ 1340 if (pd->waiting & 2) { /* sleeping in claim_or_block */
@@ -1334,8 +1351,10 @@ void parport_release(struct pardevice *dev)
1334 } 1351 }
1335 } 1352 }
1336 1353
1337 /* Nobody was waiting, so walk the list to see if anyone is 1354 /*
1338 interested in being woken up. (Note: no locking required) */ 1355 * Nobody was waiting, so walk the list to see if anyone is
1356 * interested in being woken up. (Note: no locking required)
1357 */
1339 /* !!! LOCKING IS NEEDED HERE */ 1358 /* !!! LOCKING IS NEEDED HERE */
1340 for (pd = port->devices; (port->cad == NULL) && pd; pd = pd->next) { 1359 for (pd = port->devices; (port->cad == NULL) && pd; pd = pd->next) {
1341 if (pd->wakeup && pd != dev) 1360 if (pd->wakeup && pd != dev)