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 <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
50ab9a9a60
commit
c3e6d407c0
3 changed files with 3 additions and 16 deletions
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
#include <linux/spinlock.h>
|
|
||||||
|
|
||||||
struct arqb {
|
struct arqb {
|
||||||
u64 data;
|
u64 data;
|
||||||
|
@ -83,7 +82,6 @@ struct scm_device {
|
||||||
u64 size;
|
u64 size;
|
||||||
unsigned int nr_max_block;
|
unsigned int nr_max_block;
|
||||||
struct device dev;
|
struct device dev;
|
||||||
spinlock_t lock;
|
|
||||||
struct {
|
struct {
|
||||||
unsigned int persistence:4;
|
unsigned int persistence:4;
|
||||||
unsigned int oper_state:4;
|
unsigned int oper_state:4;
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
|
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/spinlock.h>
|
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <asm/eadm.h>
|
#include <asm/eadm.h>
|
||||||
#include "scm_blk.h"
|
#include "scm_blk.h"
|
||||||
|
@ -37,15 +36,10 @@ static int scm_probe(struct scm_device *scmdev)
|
||||||
if (!bdev)
|
if (!bdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
spin_lock_irq(&scmdev->lock);
|
|
||||||
dev_set_drvdata(&scmdev->dev, bdev);
|
dev_set_drvdata(&scmdev->dev, bdev);
|
||||||
spin_unlock_irq(&scmdev->lock);
|
|
||||||
|
|
||||||
ret = scm_blk_dev_setup(bdev, scmdev);
|
ret = scm_blk_dev_setup(bdev, scmdev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
spin_lock_irq(&scmdev->lock);
|
|
||||||
dev_set_drvdata(&scmdev->dev, NULL);
|
dev_set_drvdata(&scmdev->dev, NULL);
|
||||||
spin_unlock_irq(&scmdev->lock);
|
|
||||||
kfree(bdev);
|
kfree(bdev);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -56,12 +50,9 @@ out:
|
||||||
|
|
||||||
static int scm_remove(struct scm_device *scmdev)
|
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);
|
dev_set_drvdata(&scmdev->dev, NULL);
|
||||||
spin_unlock_irq(&scmdev->lock);
|
|
||||||
scm_blk_dev_cleanup(bdev);
|
scm_blk_dev_cleanup(bdev);
|
||||||
kfree(bdev);
|
kfree(bdev);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
* Author(s): Sebastian Ott <sebott@linux.vnet.ibm.com>
|
* Author(s): Sebastian Ott <sebott@linux.vnet.ibm.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/spinlock.h>
|
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
|
@ -134,9 +133,9 @@ static ssize_t show_##name(struct device *dev, \
|
||||||
struct scm_device *scmdev = to_scm_dev(dev); \
|
struct scm_device *scmdev = to_scm_dev(dev); \
|
||||||
int ret; \
|
int ret; \
|
||||||
\
|
\
|
||||||
spin_lock(&scmdev->lock); \
|
device_lock(dev); \
|
||||||
ret = sprintf(buf, "%u\n", scmdev->attrs.name); \
|
ret = sprintf(buf, "%u\n", scmdev->attrs.name); \
|
||||||
spin_unlock(&scmdev->lock); \
|
device_unlock(dev); \
|
||||||
\
|
\
|
||||||
return ret; \
|
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.bus = &scm_bus_type;
|
||||||
scmdev->dev.release = scmdev_release;
|
scmdev->dev.release = scmdev_release;
|
||||||
scmdev->dev.groups = scmdev_attr_groups;
|
scmdev->dev.groups = scmdev_attr_groups;
|
||||||
spin_lock_init(&scmdev->lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue