Skip to content

Commit b5909c6

Browse files
wahahabgregkh
authored andcommitted
staging: kpc2000: rename variables with kpc namespace
Some namings in kpc2000_i2c are too ambiguous that may causing confusion to the readers. Rename some variable, function and struct name to prefix with 'kpc_i2c' to eliminate confusions. Signed-off-by: Jerry Lin <[email protected]> Link: https://lore.kernel.org/r/20200121024620.GA10842@compute1 Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 747a64b commit b5909c6

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

drivers/staging/kpc2000/kpc2000_i2c.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
MODULE_LICENSE("GPL");
3333
MODULE_AUTHOR("[email protected]");
3434

35-
struct i2c_device {
35+
struct kpc_i2c {
3636
unsigned long smba;
3737
struct i2c_adapter adapter;
3838
unsigned int features;
@@ -131,7 +131,7 @@ struct i2c_device {
131131
/* Make sure the SMBus host is ready to start transmitting.
132132
* Return 0 if it is, -EBUSY if it is not.
133133
*/
134-
static int i801_check_pre(struct i2c_device *priv)
134+
static int i801_check_pre(struct kpc_i2c *priv)
135135
{
136136
int status;
137137

@@ -156,7 +156,7 @@ static int i801_check_pre(struct i2c_device *priv)
156156
}
157157

158158
/* Convert the status register to an error code, and clear it. */
159-
static int i801_check_post(struct i2c_device *priv, int status, int timeout)
159+
static int i801_check_post(struct kpc_i2c *priv, int status, int timeout)
160160
{
161161
int result = 0;
162162

@@ -206,7 +206,7 @@ static int i801_check_post(struct i2c_device *priv, int status, int timeout)
206206
return result;
207207
}
208208

209-
static int i801_transaction(struct i2c_device *priv, int xact)
209+
static int i801_transaction(struct kpc_i2c *priv, int xact)
210210
{
211211
int status;
212212
int result;
@@ -235,7 +235,7 @@ static int i801_transaction(struct i2c_device *priv, int xact)
235235
}
236236

237237
/* wait for INTR bit as advised by Intel */
238-
static void i801_wait_hwpec(struct i2c_device *priv)
238+
static void i801_wait_hwpec(struct kpc_i2c *priv)
239239
{
240240
int timeout = 0;
241241
int status;
@@ -251,7 +251,7 @@ static void i801_wait_hwpec(struct i2c_device *priv)
251251
outb_p(status, SMBHSTSTS(priv));
252252
}
253253

254-
static int i801_block_transaction_by_block(struct i2c_device *priv,
254+
static int i801_block_transaction_by_block(struct kpc_i2c *priv,
255255
union i2c_smbus_data *data,
256256
char read_write, int hwpec)
257257
{
@@ -285,7 +285,7 @@ static int i801_block_transaction_by_block(struct i2c_device *priv,
285285
return 0;
286286
}
287287

288-
static int i801_block_transaction_byte_by_byte(struct i2c_device *priv,
288+
static int i801_block_transaction_byte_by_byte(struct kpc_i2c *priv,
289289
union i2c_smbus_data *data,
290290
char read_write, int command,
291291
int hwpec)
@@ -367,7 +367,7 @@ static int i801_block_transaction_byte_by_byte(struct i2c_device *priv,
367367
return 0;
368368
}
369369

370-
static int i801_set_block_buffer_mode(struct i2c_device *priv)
370+
static int i801_set_block_buffer_mode(struct kpc_i2c *priv)
371371
{
372372
outb_p(inb_p(SMBAUXCTL(priv)) | SMBAUXCTL_E32B, SMBAUXCTL(priv));
373373
if ((inb_p(SMBAUXCTL(priv)) & SMBAUXCTL_E32B) == 0)
@@ -376,7 +376,7 @@ static int i801_set_block_buffer_mode(struct i2c_device *priv)
376376
}
377377

378378
/* Block transaction function */
379-
static int i801_block_transaction(struct i2c_device *priv,
379+
static int i801_block_transaction(struct kpc_i2c *priv,
380380
union i2c_smbus_data *data, char read_write,
381381
int command, int hwpec)
382382
{
@@ -440,7 +440,7 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr,
440440
int hwpec;
441441
int block = 0;
442442
int ret, xact = 0;
443-
struct i2c_device *priv = i2c_get_adapdata(adap);
443+
struct kpc_i2c *priv = i2c_get_adapdata(adap);
444444

445445
hwpec = (priv->features & FEATURE_SMBUS_PEC) &&
446446
(flags & I2C_CLIENT_PEC) &&
@@ -578,7 +578,7 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr,
578578

579579
static u32 i801_func(struct i2c_adapter *adapter)
580580
{
581-
struct i2c_device *priv = i2c_get_adapdata(adapter);
581+
struct kpc_i2c *priv = i2c_get_adapdata(adapter);
582582

583583
/* original settings
584584
* u32 f = I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
@@ -648,10 +648,10 @@ static const struct i2c_algorithm smbus_algorithm = {
648648
/********************************
649649
*** Part 2 - Driver Handlers ***
650650
********************************/
651-
static int pi2c_probe(struct platform_device *pldev)
651+
static int kpc_i2c_probe(struct platform_device *pldev)
652652
{
653653
int err;
654-
struct i2c_device *priv;
654+
struct kpc_i2c *priv;
655655
struct resource *res;
656656

657657
priv = devm_kzalloc(&pldev->dev, sizeof(*priv), GFP_KERNEL);
@@ -700,11 +700,11 @@ static int pi2c_probe(struct platform_device *pldev)
700700
return 0;
701701
}
702702

703-
static int pi2c_remove(struct platform_device *pldev)
703+
static int kpc_i2c_remove(struct platform_device *pldev)
704704
{
705-
struct i2c_device *lddev;
705+
struct kpc_i2c *lddev;
706706

707-
lddev = (struct i2c_device *)platform_get_drvdata(pldev);
707+
lddev = (struct kpc_i2c *)platform_get_drvdata(pldev);
708708

709709
i2c_del_adapter(&lddev->adapter);
710710

@@ -718,12 +718,12 @@ static int pi2c_remove(struct platform_device *pldev)
718718
return 0;
719719
}
720720

721-
static struct platform_driver i2c_plat_driver_i = {
722-
.probe = pi2c_probe,
723-
.remove = pi2c_remove,
721+
static struct platform_driver kpc_i2c_driver = {
722+
.probe = kpc_i2c_probe,
723+
.remove = kpc_i2c_remove,
724724
.driver = {
725725
.name = KP_DRIVER_NAME_I2C,
726726
},
727727
};
728728

729-
module_platform_driver(i2c_plat_driver_i);
729+
module_platform_driver(kpc_i2c_driver);

0 commit comments

Comments
 (0)