[S390] cio: fix init_count in case of recognition after steal lock

After we try to steal a lock on a ccw device in boxed state,
we have to restart device recognition and potentially reprobing.

In this case ccw_device_init_count was erroneously decreased
twice. This patch fixes the issue.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by Sebastian Ott and committed by Martin Schwidefsky a290156f 52898025

+3 -2
+3 -2
drivers/s390/cio/device.c
··· 764 764 static void io_subchannel_register(struct ccw_device *cdev) 765 765 { 766 766 struct subchannel *sch; 767 - int ret; 767 + int ret, adjust_init_count = 1; 768 768 unsigned long flags; 769 769 770 770 sch = to_subchannel(cdev->dev.parent); ··· 793 793 cdev->private->dev_id.ssid, 794 794 cdev->private->dev_id.devno); 795 795 } 796 + adjust_init_count = 0; 796 797 goto out; 797 798 } 798 799 /* ··· 819 818 cdev->private->flags.recog_done = 1; 820 819 wake_up(&cdev->private->wait_q); 821 820 out_err: 822 - if (atomic_dec_and_test(&ccw_device_init_count)) 821 + if (adjust_init_count && atomic_dec_and_test(&ccw_device_init_count)) 823 822 wake_up(&ccw_device_init_wq); 824 823 } 825 824