[PATCH linux dev-4.10 07/16] hwmon (p9_sbe): Rename lock member of struct p9_sbe_occ
Andrew Jeffery
andrew at aj.id.au
Thu Feb 15 23:35:57 AEDT 2018
Improve code clarity (and searchability) by renaming the lock to client_lock.
The end result is it is easier to search for uses in the source file.
Signed-off-by: Andrew Jeffery <andrew at aj.id.au>
---
drivers/hwmon/occ/p9_sbe.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/hwmon/occ/p9_sbe.c b/drivers/hwmon/occ/p9_sbe.c
index 52473d020b24..7b1da81515e2 100644
--- a/drivers/hwmon/occ/p9_sbe.c
+++ b/drivers/hwmon/occ/p9_sbe.c
@@ -35,7 +35,7 @@ struct p9_sbe_occ {
* open, close and NULL assignment. This prevents simultaneous opening
* and closing of the client, or closing multiple times.
*/
- spinlock_t lock;
+ spinlock_t client_lock;
};
#define to_p9_sbe_occ(x) container_of((x), struct p9_sbe_occ, occ)
@@ -44,11 +44,11 @@ static void p9_sbe_occ_close_client(struct p9_sbe_occ *ctx)
{
struct occ_client *tmp_client;
- spin_lock_irq(&ctx->lock);
+ spin_lock_irq(&ctx->client_lock);
tmp_client = ctx->client;
ctx->client = NULL;
occ_drv_release(tmp_client);
- spin_unlock_irq(&ctx->lock);
+ spin_unlock_irq(&ctx->client_lock);
}
static int p9_sbe_occ_send_cmd(struct occ *occ, u8 *cmd)
@@ -57,10 +57,10 @@ static int p9_sbe_occ_send_cmd(struct occ *occ, u8 *cmd)
struct occ_response *resp = &occ->resp;
struct p9_sbe_occ *ctx = to_p9_sbe_occ(occ);
- spin_lock_irq(&ctx->lock);
+ spin_lock_irq(&ctx->client_lock);
if (ctx->sbe)
ctx->client = occ_drv_open(ctx->sbe, 0);
- spin_unlock_irq(&ctx->lock);
+ spin_unlock_irq(&ctx->client_lock);
if (!ctx->client) {
rc = -ENODEV;
@@ -163,7 +163,7 @@ static int p9_sbe_occ_probe(struct platform_device *pdev)
ctx->sbe = pdev->dev.parent;
occ = &ctx->occ;
- spin_lock_init(&ctx->lock);
+ spin_lock_init(&ctx->client_lock);
occ->bus_dev = &pdev->dev;
occ->groups[0] = &occ->group;
occ->poll_cmd_data = 0x20;
--
2.14.1
More information about the openbmc
mailing list