[PATCH] sbus: bbc_i2c.c: fixed various coding style issues

From: Michael Harris
Date: Wed Mar 15 2023 - 02:25:37 EST


Fixed various issues given from checkpatch.pl

Signed-off-by: Michael Harris <michaelharriscode@xxxxxxxxx>
---
drivers/sbus/char/bbc_i2c.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c
index 537e55cd038d..c0df890f1aec 100644
--- a/drivers/sbus/char/bbc_i2c.c
+++ b/drivers/sbus/char/bbc_i2c.c
@@ -16,7 +16,7 @@
#include <linux/of.h>
#include <linux/of_device.h>
#include <asm/bbc.h>
-#include <asm/io.h>
+#include <linux/io.h>

#include "bbc_i2c.h"

@@ -32,7 +32,7 @@

#define I2C_PCF_START (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ENI | I2C_PCF_STA | I2C_PCF_ACK)
#define I2C_PCF_STOP (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STO | I2C_PCF_ACK)
-#define I2C_PCF_REPSTART ( I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
+#define I2C_PCF_REPSTART (I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
#define I2C_PCF_IDLE (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ACK)

#define I2C_PCF_INI 0x40 /* 1 if not initialized */
@@ -63,8 +63,8 @@ static void set_device_claimage(struct bbc_i2c_bus *bp, struct platform_device *
}
}

-#define claim_device(BP,ECHILD) set_device_claimage(BP,ECHILD,1)
-#define release_device(BP,ECHILD) set_device_claimage(BP,ECHILD,0)
+#define claim_device(BP, ECHILD) set_device_claimage(BP, ECHILD, 1)
+#define release_device(BP, ECHILD) set_device_claimage(BP, ECHILD, 0)

struct platform_device *bbc_i2c_getdev(struct bbc_i2c_bus *bp, int index)
{
@@ -72,8 +72,10 @@ struct platform_device *bbc_i2c_getdev(struct bbc_i2c_bus *bp, int index)
int curidx = 0, i;

for (i = 0; i < NUM_CHILDREN; i++) {
- if (!(op = bp->devs[i].device))
+ if (!bp->devs[i].device) {
+ op = bp->devs[i].device;
break;
+ }
if (curidx == index)
goto out;
op = NULL;
@@ -85,6 +87,7 @@ struct platform_device *bbc_i2c_getdev(struct bbc_i2c_bus *bp, int index)
return op;
return NULL;
}
+EXPORT_SYMBOL(bbc_i2c_getdev);

struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct platform_device *op)
{
@@ -110,6 +113,7 @@ struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct platform_de

return client;
}
+EXPORT_SYMBOL(bbc_i2c_attach);

void bbc_i2c_detach(struct bbc_i2c_client *client)
{
@@ -119,6 +123,7 @@ void bbc_i2c_detach(struct bbc_i2c_client *client)
release_device(bp, op);
kfree(client);
}
+EXPORT_SYMBOL(bbc_i2c_detach);

static int wait_for_pin(struct bbc_i2c_bus *bp, u8 *status)
{
@@ -177,6 +182,7 @@ int bbc_i2c_writeb(struct bbc_i2c_client *client, unsigned char val, int off)
writeb(I2C_PCF_STOP, bp->i2c_control_regs + 0x0);
return ret;
}
+EXPORT_SYMBOL(bbc_i2c_writeb);

int bbc_i2c_readb(struct bbc_i2c_client *client, unsigned char *byte, int off)
{
@@ -226,6 +232,7 @@ int bbc_i2c_readb(struct bbc_i2c_client *client, unsigned char *byte, int off)

return ret;
}
+EXPORT_SYMBOL(bbc_i2c_readb);

int bbc_i2c_write_buf(struct bbc_i2c_client *client,
char *buf, int len, int off)
@@ -242,6 +249,7 @@ int bbc_i2c_write_buf(struct bbc_i2c_client *client,
}
return ret;
}
+EXPORT_SYMBOL(bbc_i2c_write_buf);

int bbc_i2c_read_buf(struct bbc_i2c_client *client,
char *buf, int len, int off)
@@ -259,13 +267,6 @@ int bbc_i2c_read_buf(struct bbc_i2c_client *client,

return ret;
}
-
-EXPORT_SYMBOL(bbc_i2c_getdev);
-EXPORT_SYMBOL(bbc_i2c_attach);
-EXPORT_SYMBOL(bbc_i2c_detach);
-EXPORT_SYMBOL(bbc_i2c_writeb);
-EXPORT_SYMBOL(bbc_i2c_readb);
-EXPORT_SYMBOL(bbc_i2c_write_buf);
EXPORT_SYMBOL(bbc_i2c_read_buf);

static irqreturn_t bbc_i2c_interrupt(int irq, void *dev_id)
@@ -291,7 +292,7 @@ static void reset_one_i2c(struct bbc_i2c_bus *bp)
writeb(I2C_PCF_IDLE, bp->i2c_control_regs + 0x0);
}

-static struct bbc_i2c_bus * attach_one_i2c(struct platform_device *op, int index)
+static struct bbc_i2c_bus *attach_one_i2c(struct platform_device *op, int index)
{
struct bbc_i2c_bus *bp;
struct device_node *dp;
@@ -341,7 +342,7 @@ static struct bbc_i2c_bus * attach_one_i2c(struct platform_device *op, int index
writeb(I2C_PCF_PIN | I2C_PCF_ES1, bp->i2c_control_regs + 0x0);
bp->clock = readb(bp->i2c_control_regs + 0x01);

- printk(KERN_INFO "i2c-%d: Regs at %p, %d devices, own %02x, clock %02x.\n",
+ pr_info("i2c-%d: Regs at %p, %d devices, own %02x, clock %02x.\n",
bp->index, bp->i2c_control_regs, entry, bp->own, bp->clock);

reset_one_i2c(bp);
--
2.34.1