summaryrefslogtreecommitdiff
path: root/drivers/media/pci/cx88/cx88-vp3054-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-19 19:27:30 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-25 07:50:20 -0200
commit399426cadf5b0539a5b2a4d805257ce8acc6aba2 (patch)
tree40dec68657fbd2904ec6da9c2082fd29d0f3b437 /drivers/media/pci/cx88/cx88-vp3054-i2c.c
parent1d38971438157dc57f0a4be89abf23b472458633 (diff)
[media] cx88: make checkpatch.pl happy
Usually, I don't like fixing coding style issues on non-staging drivers, as it could be a mess pretty easy, and could become like a snow ball. That's the case of recent changes on two changesets: they disalign some statements. Yet, a care a lot with cx88 driver, as it was the first driver I touched at the Kernel, and I've been maintaining it since 2005. So, several of the coding style issues were due to my code. Per Andrey's suggestion, I ran checkpatch.pl in strict mode, with fixed several other issues, did some function alinments, but broke other alinments. So, I had to manually apply another round of manual fixes to make sure that everything is ok, and to make checkpatch happy with this patch. With this patch, checkpatch.pl is now happy when called with: ./scripts/checkpatch.pl -f --max-line-length=998 --ignore PREFER_PR_LEVEL Also, the 80-cols violations that made sense were fixed. Checkpatch would be happier if we convert it to use dev_foo(), but this is a more complex change. NOTE: there are some places with msleep(1). As this driver was written at the time that the default was to sleep at least 10ms on such calls (e. g. CONFIG_HZ=100), I replaced those calls by usleep_range(10000, 20000), with should be safe to avoid breakages. Fixes: 65bc2fe86e66 ("[media] cx88: convert it to use pr_foo() macros") Fixes: 7b61ba8ff838 ("[media] cx88: make checkpatch happier") Suggested-by: Andrey Utkin <andrey_utkin@fastmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Reviewed-by: Andrey Utkin <andrey_utkin@fastmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/cx88/cx88-vp3054-i2c.c')
-rw-r--r--drivers/media/pci/cx88/cx88-vp3054-i2c.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/pci/cx88/cx88-vp3054-i2c.c b/drivers/media/pci/cx88/cx88-vp3054-i2c.c
index eea56ae9071e..92876de3841c 100644
--- a/drivers/media/pci/cx88/cx88-vp3054-i2c.c
+++ b/drivers/media/pci/cx88/cx88-vp3054-i2c.c
@@ -22,8 +22,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
-
-#include <asm/io.h>
+#include <linux/io.h>
MODULE_DESCRIPTION("driver for cx2388x VP3054 design");
MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
@@ -108,7 +107,7 @@ int vp3054_i2c_probe(struct cx8802_dev *dev)
return 0;
vp3054_i2c = kzalloc(sizeof(*vp3054_i2c), GFP_KERNEL);
- if (vp3054_i2c == NULL)
+ if (!vp3054_i2c)
return -ENOMEM;
dev->vp3054 = vp3054_i2c;
@@ -135,18 +134,17 @@ int vp3054_i2c_probe(struct cx8802_dev *dev)
return rc;
}
+EXPORT_SYMBOL(vp3054_i2c_probe);
void vp3054_i2c_remove(struct cx8802_dev *dev)
{
struct vp3054_i2c_state *vp3054_i2c = dev->vp3054;
- if (vp3054_i2c == NULL ||
+ if (!vp3054_i2c ||
dev->core->boardnr != CX88_BOARD_DNTV_LIVE_DVB_T_PRO)
return;
i2c_del_adapter(&vp3054_i2c->adap);
kfree(vp3054_i2c);
}
-
-EXPORT_SYMBOL(vp3054_i2c_probe);
EXPORT_SYMBOL(vp3054_i2c_remove);