From c3e6d407c0c09fb46a391bdd0a28827472825de7 Mon Sep 17 00:00:00 2001 From: Sebastian Ott Date: Tue, 4 Sep 2012 19:36:41 +0200 Subject: s390/scm: remove superfluous lock Remove the spinlock from struct scm_device. drvdata and attributes are guarded via device_lock. Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky diff --git a/arch/s390/include/asm/eadm.h b/arch/s390/include/asm/eadm.h index 4d6e103..8d48471 100644 --- a/arch/s390/include/asm/eadm.h +++ b/arch/s390/include/asm/eadm.h @@ -3,7 +3,6 @@ #include #include -#include struct arqb { u64 data; @@ -83,7 +82,6 @@ struct scm_device { u64 size; unsigned int nr_max_block; struct device dev; - spinlock_t lock; struct { unsigned int persistence:4; unsigned int oper_state:4; diff --git a/drivers/s390/block/scm_drv.c b/drivers/s390/block/scm_drv.c index fce711a..349966f 100644 --- a/drivers/s390/block/scm_drv.c +++ b/drivers/s390/block/scm_drv.c @@ -9,7 +9,6 @@ #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt #include -#include #include #include #include "scm_blk.h" @@ -37,15 +36,10 @@ static int scm_probe(struct scm_device *scmdev) if (!bdev) return -ENOMEM; - spin_lock_irq(&scmdev->lock); dev_set_drvdata(&scmdev->dev, bdev); - spin_unlock_irq(&scmdev->lock); - ret = scm_blk_dev_setup(bdev, scmdev); if (ret) { - spin_lock_irq(&scmdev->lock); dev_set_drvdata(&scmdev->dev, NULL); - spin_unlock_irq(&scmdev->lock); kfree(bdev); goto out; } @@ -56,12 +50,9 @@ out: static int scm_remove(struct scm_device *scmdev) { - struct scm_blk_dev *bdev; + struct scm_blk_dev *bdev = dev_get_drvdata(&scmdev->dev); - spin_lock_irq(&scmdev->lock); - bdev = dev_get_drvdata(&scmdev->dev); dev_set_drvdata(&scmdev->dev, NULL); - spin_unlock_irq(&scmdev->lock); scm_blk_dev_cleanup(bdev); kfree(bdev); diff --git a/drivers/s390/cio/scm.c b/drivers/s390/cio/scm.c index aa4476e..bcf20f3 100644 --- a/drivers/s390/cio/scm.c +++ b/drivers/s390/cio/scm.c @@ -5,7 +5,6 @@ * Author(s): Sebastian Ott */ -#include #include #include #include @@ -134,9 +133,9 @@ static ssize_t show_##name(struct device *dev, \ struct scm_device *scmdev = to_scm_dev(dev); \ int ret; \ \ - spin_lock(&scmdev->lock); \ + device_lock(dev); \ ret = sprintf(buf, "%u\n", scmdev->attrs.name); \ - spin_unlock(&scmdev->lock); \ + device_unlock(dev); \ \ return ret; \ } \ @@ -193,7 +192,6 @@ static void scmdev_setup(struct scm_device *scmdev, struct sale *sale, scmdev->dev.bus = &scm_bus_type; scmdev->dev.release = scmdev_release; scmdev->dev.groups = scmdev_attr_groups; - spin_lock_init(&scmdev->lock); } /* -- cgit v0.10.2