Commit 757d78d3 authored by Daniel Scheller's avatar Daniel Scheller Committed by Mauro Carvalho Chehab

media: ddbridge: fixup checkpatch-strict issues

Fixes several alignment, braces, space-before-cast, camelcase et al issues
reported by checkpatch --strict, plus a few more checkpatch didn't report.

Three checks are left after this though:
- one CamelCase in ddbridge-core, related to defines/vars/enums referenced
  from the stv090x demod driver
- one macro argument reuse in ddbridge-core aswell
- one unbalanced braces around else in ddbridge-main, which is due to
  #ifdefs related to CONFIG_PCI_MSI, which preferrably should be kept
  as-is for readability.
Signed-off-by: default avatarDaniel Scheller <d.scheller@gmx.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 1d8343aa
This diff is collapsed.
...@@ -185,7 +185,7 @@ static const struct ddb_info ddb_ctv7 = { ...@@ -185,7 +185,7 @@ static const struct ddb_info ddb_ctv7 = {
.board_control_2 = 4, .board_control_2 = 4,
}; };
static const struct ddb_info ddb_satixS2v3 = { static const struct ddb_info ddb_satixs2v3 = {
.type = DDB_OCTOPUS, .type = DDB_OCTOPUS,
.name = "Mystique SaTiX-S2 V3 DVB adapter", .name = "Mystique SaTiX-S2 V3 DVB adapter",
.regmap = &octopus_map, .regmap = &octopus_map,
...@@ -336,7 +336,7 @@ static const struct ddb_device_id ddb_device_ids[] = { ...@@ -336,7 +336,7 @@ static const struct ddb_device_id ddb_device_ids[] = {
DDB_DEVID(0x0006, 0x0022, ddb_v7), DDB_DEVID(0x0006, 0x0022, ddb_v7),
DDB_DEVID(0x0006, 0x0024, ddb_v7a), DDB_DEVID(0x0006, 0x0024, ddb_v7a),
DDB_DEVID(0x0003, 0x0030, ddb_dvbct), DDB_DEVID(0x0003, 0x0030, ddb_dvbct),
DDB_DEVID(0x0003, 0xdb03, ddb_satixS2v3), DDB_DEVID(0x0003, 0xdb03, ddb_satixs2v3),
DDB_DEVID(0x0006, 0x0031, ddb_ctv7), DDB_DEVID(0x0006, 0x0031, ddb_ctv7),
DDB_DEVID(0x0006, 0x0032, ddb_ctv7), DDB_DEVID(0x0006, 0x0032, ddb_ctv7),
DDB_DEVID(0x0006, 0x0033, ddb_ctv7), DDB_DEVID(0x0006, 0x0033, ddb_ctv7),
...@@ -367,8 +367,8 @@ const struct ddb_info *get_ddb_info(u16 vendor, u16 device, ...@@ -367,8 +367,8 @@ const struct ddb_info *get_ddb_info(u16 vendor, u16 device,
if (vendor == id->vendor && if (vendor == id->vendor &&
device == id->device && device == id->device &&
subvendor == id->subvendor && subvendor == id->subvendor &&
((subdevice == id->subdevice) || (subdevice == id->subdevice ||
(id->subdevice == 0xffff))) id->subdevice == 0xffff))
return id->info; return id->info;
} }
......
...@@ -81,7 +81,7 @@ static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd) ...@@ -81,7 +81,7 @@ static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd)
static int ddb_i2c_master_xfer(struct i2c_adapter *adapter, static int ddb_i2c_master_xfer(struct i2c_adapter *adapter,
struct i2c_msg msg[], int num) struct i2c_msg msg[], int num)
{ {
struct ddb_i2c *i2c = (struct ddb_i2c *) i2c_get_adapdata(adapter); struct ddb_i2c *i2c = (struct ddb_i2c *)i2c_get_adapdata(adapter);
struct ddb *dev = i2c->dev; struct ddb *dev = i2c->dev;
u8 addr = 0; u8 addr = 0;
...@@ -149,7 +149,7 @@ void ddb_i2c_release(struct ddb *dev) ...@@ -149,7 +149,7 @@ void ddb_i2c_release(struct ddb *dev)
static void i2c_handler(unsigned long priv) static void i2c_handler(unsigned long priv)
{ {
struct ddb_i2c *i2c = (struct ddb_i2c *) priv; struct ddb_i2c *i2c = (struct ddb_i2c *)priv;
complete(&i2c->completion); complete(&i2c->completion);
} }
...@@ -177,7 +177,7 @@ static int ddb_i2c_add(struct ddb *dev, struct ddb_i2c *i2c, ...@@ -177,7 +177,7 @@ static int ddb_i2c_add(struct ddb *dev, struct ddb_i2c *i2c,
adap = &i2c->adap; adap = &i2c->adap;
i2c_set_adapdata(adap, i2c); i2c_set_adapdata(adap, i2c);
#ifdef I2C_ADAP_CLASS_TV_DIGITAL #ifdef I2C_ADAP_CLASS_TV_DIGITAL
adap->class = I2C_ADAP_CLASS_TV_DIGITAL|I2C_CLASS_TV_ANALOG; adap->class = I2C_ADAP_CLASS_TV_DIGITAL | I2C_CLASS_TV_ANALOG;
#else #else
#ifdef I2C_CLASS_TV_ANALOG #ifdef I2C_CLASS_TV_ANALOG
adap->class = I2C_CLASS_TV_ANALOG; adap->class = I2C_CLASS_TV_ANALOG;
...@@ -210,7 +210,7 @@ int ddb_i2c_init(struct ddb *dev) ...@@ -210,7 +210,7 @@ int ddb_i2c_init(struct ddb *dev)
if (!(dev->link[l].info->i2c_mask & (1 << i))) if (!(dev->link[l].info->i2c_mask & (1 << i)))
continue; continue;
i2c = &dev->i2c[num]; i2c = &dev->i2c[num];
dev->handler_data[l][i + base] = (unsigned long) i2c; dev->handler_data[l][i + base] = (unsigned long)i2c;
dev->handler[l][i + base] = i2c_handler; dev->handler[l][i + base] = i2c_handler;
stat = ddb_i2c_add(dev, i2c, regmap, l, i, num); stat = ddb_i2c_add(dev, i2c, regmap, l, i, num);
if (stat) if (stat)
...@@ -224,7 +224,9 @@ int ddb_i2c_init(struct ddb *dev) ...@@ -224,7 +224,9 @@ int ddb_i2c_init(struct ddb *dev)
adap = &i2c->adap; adap = &i2c->adap;
i2c_del_adapter(adap); i2c_del_adapter(adap);
} }
} else } else {
dev->i2c_num = num; dev->i2c_num = num;
}
return stat; return stat;
} }
...@@ -107,7 +107,7 @@ static void ddb_irq_exit(struct ddb *dev) ...@@ -107,7 +107,7 @@ static void ddb_irq_exit(struct ddb *dev)
static void ddb_remove(struct pci_dev *pdev) static void ddb_remove(struct pci_dev *pdev)
{ {
struct ddb *dev = (struct ddb *) pci_get_drvdata(pdev); struct ddb *dev = (struct ddb *)pci_get_drvdata(pdev);
ddb_device_destroy(dev); ddb_device_destroy(dev);
ddb_ports_detach(dev); ddb_ports_detach(dev);
...@@ -133,9 +133,10 @@ static void ddb_irq_msi(struct ddb *dev, int nr) ...@@ -133,9 +133,10 @@ static void ddb_irq_msi(struct ddb *dev, int nr)
dev->msi = stat; dev->msi = stat;
dev_info(dev->dev, "using %d MSI interrupt(s)\n", dev_info(dev->dev, "using %d MSI interrupt(s)\n",
dev->msi); dev->msi);
} else } else {
dev_info(dev->dev, "MSI not available.\n"); dev_info(dev->dev, "MSI not available.\n");
} }
}
} }
#endif #endif
...@@ -160,11 +161,11 @@ static int ddb_irq_init(struct ddb *dev) ...@@ -160,11 +161,11 @@ static int ddb_irq_init(struct ddb *dev)
irq_flag = 0; irq_flag = 0;
if (dev->msi == 2) { if (dev->msi == 2) {
stat = request_irq(dev->pdev->irq, ddb_irq_handler0, stat = request_irq(dev->pdev->irq, ddb_irq_handler0,
irq_flag, "ddbridge", (void *) dev); irq_flag, "ddbridge", (void *)dev);
if (stat < 0) if (stat < 0)
return stat; return stat;
stat = request_irq(dev->pdev->irq + 1, ddb_irq_handler1, stat = request_irq(dev->pdev->irq + 1, ddb_irq_handler1,
irq_flag, "ddbridge", (void *) dev); irq_flag, "ddbridge", (void *)dev);
if (stat < 0) { if (stat < 0) {
free_irq(dev->pdev->irq, dev); free_irq(dev->pdev->irq, dev);
return stat; return stat;
...@@ -173,7 +174,7 @@ static int ddb_irq_init(struct ddb *dev) ...@@ -173,7 +174,7 @@ static int ddb_irq_init(struct ddb *dev)
#endif #endif
{ {
stat = request_irq(dev->pdev->irq, ddb_irq_handler, stat = request_irq(dev->pdev->irq, ddb_irq_handler,
irq_flag, "ddbridge", (void *) dev); irq_flag, "ddbridge", (void *)dev);
if (stat < 0) if (stat < 0)
return stat; return stat;
} }
...@@ -202,8 +203,8 @@ static int ddb_probe(struct pci_dev *pdev, ...@@ -202,8 +203,8 @@ static int ddb_probe(struct pci_dev *pdev,
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))
return -ENODEV; return -ENODEV;
dev = vzalloc(sizeof(struct ddb)); dev = vzalloc(sizeof(*dev));
if (dev == NULL) if (!dev)
return -ENOMEM; return -ENOMEM;
mutex_init(&dev->mutex); mutex_init(&dev->mutex);
...@@ -317,7 +318,7 @@ static __init int module_init_ddbridge(void) ...@@ -317,7 +318,7 @@ static __init int module_init_ddbridge(void)
if (ddb_class_create() < 0) if (ddb_class_create() < 0)
return -1; return -1;
ddb_wq = create_workqueue("ddbridge"); ddb_wq = create_workqueue("ddbridge");
if (ddb_wq == NULL) if (!ddb_wq)
goto exit1; goto exit1;
stat = pci_register_driver(&ddb_pci_driver); stat = pci_register_driver(&ddb_pci_driver);
if (stat < 0) if (stat < 0)
......
...@@ -291,34 +291,45 @@ static int max_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage) ...@@ -291,34 +291,45 @@ static int max_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage)
if (nv != ov) { if (nv != ov) {
if (nv) { if (nv) {
lnb_set_voltage(dev, lnb_set_voltage(
port->lnr, 0, SEC_VOLTAGE_13); dev, port->lnr,
0, SEC_VOLTAGE_13);
if (fmode == 1) { if (fmode == 1) {
lnb_set_voltage(dev, port->lnr, lnb_set_voltage(
dev, port->lnr,
0, SEC_VOLTAGE_13); 0, SEC_VOLTAGE_13);
if (old_quattro) { if (old_quattro) {
lnb_set_voltage(dev, port->lnr, lnb_set_voltage(
dev, port->lnr,
1, SEC_VOLTAGE_18); 1, SEC_VOLTAGE_18);
lnb_set_voltage(dev, port->lnr, lnb_set_voltage(
dev, port->lnr,
2, SEC_VOLTAGE_13); 2, SEC_VOLTAGE_13);
} else { } else {
lnb_set_voltage(dev, port->lnr, lnb_set_voltage(
dev, port->lnr,
1, SEC_VOLTAGE_13); 1, SEC_VOLTAGE_13);
lnb_set_voltage(dev, port->lnr, lnb_set_voltage(
dev, port->lnr,
2, SEC_VOLTAGE_18); 2, SEC_VOLTAGE_18);
} }
lnb_set_voltage(dev, port->lnr, lnb_set_voltage(
dev, port->lnr,
3, SEC_VOLTAGE_18); 3, SEC_VOLTAGE_18);
} }
} else { } else {
lnb_set_voltage(dev, port->lnr, lnb_set_voltage(
dev, port->lnr,
0, SEC_VOLTAGE_OFF); 0, SEC_VOLTAGE_OFF);
if (fmode == 1) { if (fmode == 1) {
lnb_set_voltage(dev, port->lnr, lnb_set_voltage(
dev, port->lnr,
1, SEC_VOLTAGE_OFF); 1, SEC_VOLTAGE_OFF);
lnb_set_voltage(dev, port->lnr, lnb_set_voltage(
dev, port->lnr,
2, SEC_VOLTAGE_OFF); 2, SEC_VOLTAGE_OFF);
lnb_set_voltage(dev, port->lnr, lnb_set_voltage(
dev, port->lnr,
3, SEC_VOLTAGE_OFF); 3, SEC_VOLTAGE_OFF);
} }
} }
...@@ -331,7 +342,6 @@ static int max_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage) ...@@ -331,7 +342,6 @@ static int max_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage)
static int max_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg) static int max_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg)
{ {
return 0; return 0;
} }
......
...@@ -95,16 +95,16 @@ ...@@ -95,16 +95,16 @@
#define DMA_BASE_WRITE (0x100) #define DMA_BASE_WRITE (0x100)
#define DMA_BASE_READ (0x140) #define DMA_BASE_READ (0x140)
#define TS_CONTROL(_io) (_io->regs + 0x00) #define TS_CONTROL(_io) ((_io)->regs + 0x00)
#define TS_CONTROL2(_io) (_io->regs + 0x04) #define TS_CONTROL2(_io) ((_io)->regs + 0x04)
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/* DMA Buffer */ /* DMA Buffer */
#define DMA_BUFFER_CONTROL(_dma) (_dma->regs + 0x00) #define DMA_BUFFER_CONTROL(_dma) ((_dma)->regs + 0x00)
#define DMA_BUFFER_ACK(_dma) (_dma->regs + 0x04) #define DMA_BUFFER_ACK(_dma) ((_dma)->regs + 0x04)
#define DMA_BUFFER_CURRENT(_dma) (_dma->regs + 0x08) #define DMA_BUFFER_CURRENT(_dma) ((_dma)->regs + 0x08)
#define DMA_BUFFER_SIZE(_dma) (_dma->regs + 0x0c) #define DMA_BUFFER_SIZE(_dma) ((_dma)->regs + 0x0c)
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/* CI Interface (only CI-Bridge) */ /* CI Interface (only CI-Bridge) */
...@@ -148,8 +148,8 @@ ...@@ -148,8 +148,8 @@
#define LNB_CMD_OFF 5 #define LNB_CMD_OFF 5
#define LNB_CMD_DISEQC 6 #define LNB_CMD_DISEQC 6
#define LNB_BUSY (1ULL << 4) #define LNB_BUSY BIT_ULL(4)
#define LNB_TONE (1ULL << 15) #define LNB_TONE BIT_ULL(15)
#define LNB_BUF_LEVEL(i) (LNB_BASE + (i) * 0x20 + 0x10) #define LNB_BUF_LEVEL(i) (LNB_BASE + (i) * 0x20 + 0x10)
#define LNB_BUF_WRITE(i) (LNB_BASE + (i) * 0x20 + 0x14) #define LNB_BUF_WRITE(i) (LNB_BASE + (i) * 0x20 + 0x14)
......
...@@ -143,11 +143,11 @@ struct ddb_info { ...@@ -143,11 +143,11 @@ struct ddb_info {
#define DMA_MAX_BUFS 32 /* hardware table limit */ #define DMA_MAX_BUFS 32 /* hardware table limit */
#define INPUT_DMA_BUFS 8 #define INPUT_DMA_BUFS 8
#define INPUT_DMA_SIZE (128*47*21) #define INPUT_DMA_SIZE (128 * 47 * 21)
#define INPUT_DMA_IRQ_DIV 1 #define INPUT_DMA_IRQ_DIV 1
#define OUTPUT_DMA_BUFS 8 #define OUTPUT_DMA_BUFS 8
#define OUTPUT_DMA_SIZE (128*47*21) #define OUTPUT_DMA_SIZE (128 * 47 * 21)
#define OUTPUT_DMA_IRQ_DIV 1 #define OUTPUT_DMA_IRQ_DIV 1
struct ddb; struct ddb;
...@@ -166,7 +166,7 @@ struct ddb_dma { ...@@ -166,7 +166,7 @@ struct ddb_dma {
u32 bufval; u32 bufval;
struct work_struct work; struct work_struct work;
spinlock_t lock; spinlock_t lock; /* DMA lock */
wait_queue_head_t wq; wait_queue_head_t wq;
int running; int running;
u32 stat; u32 stat;
...@@ -206,7 +206,6 @@ struct ddb_ci { ...@@ -206,7 +206,6 @@ struct ddb_ci {
struct dvb_ca_en50221 en; struct dvb_ca_en50221 en;
struct ddb_port *port; struct ddb_port *port;
u32 nr; u32 nr;
struct mutex lock;
}; };
struct ddb_io { struct ddb_io {
...@@ -240,7 +239,7 @@ struct ddb_port { ...@@ -240,7 +239,7 @@ struct ddb_port {
u32 regs; u32 regs;
u32 lnr; u32 lnr;
struct ddb_i2c *i2c; struct ddb_i2c *i2c;
struct mutex i2c_gate_lock; struct mutex i2c_gate_lock; /* I2C access lock */
u32 class; u32 class;
#define DDB_PORT_NONE 0 #define DDB_PORT_NONE 0
#define DDB_PORT_CI 1 #define DDB_PORT_CI 1
...@@ -297,7 +296,7 @@ struct ddb_port { ...@@ -297,7 +296,7 @@ struct ddb_port {
#define TS_CAPTURE_LEN (4096) #define TS_CAPTURE_LEN (4096)
struct ddb_lnb { struct ddb_lnb {
struct mutex lock; struct mutex lock; /* lock lnb access */
u32 tone; u32 tone;
enum fe_sec_voltage oldvoltage[4]; enum fe_sec_voltage oldvoltage[4];
u32 voltage[4]; u32 voltage[4];
...@@ -310,13 +309,13 @@ struct ddb_link { ...@@ -310,13 +309,13 @@ struct ddb_link {
const struct ddb_info *info; const struct ddb_info *info;
u32 nr; u32 nr;
u32 regs; u32 regs;
spinlock_t lock; spinlock_t lock; /* lock link access */
struct mutex flash_mutex; struct mutex flash_mutex; /* lock flash access */
struct ddb_lnb lnb; struct ddb_lnb lnb;
struct tasklet_struct tasklet; struct tasklet_struct tasklet;
struct ddb_ids ids; struct ddb_ids ids;
spinlock_t temp_lock; spinlock_t temp_lock; /* lock temp chip access */
int overtemperature_error; int overtemperature_error;
u8 temp_tab[11]; u8 temp_tab[11];
}; };
...@@ -355,7 +354,7 @@ struct ddb { ...@@ -355,7 +354,7 @@ struct ddb {
u32 ts_irq; u32 ts_irq;
u32 i2c_irq; u32 i2c_irq;
struct mutex mutex; struct mutex mutex; /* lock access to global ddb array */
u8 tsbuf[TS_CAPTURE_LEN]; u8 tsbuf[TS_CAPTURE_LEN];
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment