#define DPC_BOARD_CAN_DO_VBI(dev) (dev->revision != 0)
static int debug = 0;
-MODULE_PARM(debug,"i");
+module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "debug verbosity");
-/* global variables */
-int dpc_num = 0;
+static int dpc_num = 0;
#define DPC_INPUTS 2
static struct v4l2_input dpc_inputs[DPC_INPUTS] = {
struct dpc
{
- struct video_device video_dev;
- struct video_device vbi_dev;
+ struct video_device *video_dev;
+ struct video_device *vbi_dev;
struct i2c_adapter i2c_adapter;
struct i2c_client *saa7111a;
struct i2c_client *client;
struct list_head *item;
- dpc = (struct dpc*)kmalloc(sizeof(struct dpc), GFP_KERNEL);
+ dpc = kzalloc(sizeof(struct dpc), GFP_KERNEL);
if( NULL == dpc ) {
printk("dpc_v4l2.o: dpc_probe: not enough kernel memory.\n");
return -ENOMEM;
}
- memset(dpc, 0x0, sizeof(struct dpc));
/* FIXME: enable i2c-port pins, video-port-pins
video port pins should be enabled here ?! */
saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26));
- saa7146_i2c_adapter_prepare(dev, &dpc->i2c_adapter, I2C_CLASS_TV_ANALOG, SAA7146_I2C_BUS_BIT_RATE_480);
+ dpc->i2c_adapter = (struct i2c_adapter) {
+ .class = I2C_CLASS_TV_ANALOG,
+ .name = "dpc7146",
+ };
+ saa7146_i2c_adapter_prepare(dev, &dpc->i2c_adapter, SAA7146_I2C_BUS_BIT_RATE_480);
if(i2c_add_adapter(&dpc->i2c_adapter) < 0) {
DEB_S(("cannot register i2c-device. skipping.\n"));
kfree(dpc);
.irq_func = NULL,
};
-int __init dpc_init_module(void)
+static int __init dpc_init_module(void)
{
if( 0 != saa7146_register_extension(&extension)) {
DEB_S(("failed to register extension.\n"));
return 0;
}
-void __exit dpc_cleanup_module(void)
+static void __exit dpc_cleanup_module(void)
{
saa7146_unregister_extension(&extension);
}