diff options
Diffstat (limited to 'drivers/staging/media')
-rw-r--r-- | drivers/staging/media/bcm2048/radio-bcm2048.c | 14 | ||||
-rw-r--r-- | drivers/staging/media/cxd2099/cxd2099.c | 2 | ||||
-rw-r--r-- | drivers/staging/media/davinci_vpfe/davinci_vpfe_user.h | 36 | ||||
-rw-r--r-- | drivers/staging/media/davinci_vpfe/dm365_isif.c | 8 | ||||
-rw-r--r-- | drivers/staging/media/davinci_vpfe/dm365_resizer.c | 2 | ||||
-rw-r--r-- | drivers/staging/media/davinci_vpfe/vpfe_video.c | 14 | ||||
-rw-r--r-- | drivers/staging/media/lirc/lirc_bt829.c | 7 | ||||
-rw-r--r-- | drivers/staging/media/lirc/lirc_imon.c | 37 | ||||
-rw-r--r-- | drivers/staging/media/lirc/lirc_parallel.c | 6 | ||||
-rw-r--r-- | drivers/staging/media/lirc/lirc_sasem.c | 26 |
10 files changed, 59 insertions, 93 deletions
diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c index 8dade19..ea15cc6 100644 --- a/drivers/staging/media/bcm2048/radio-bcm2048.c +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c @@ -483,10 +483,8 @@ static int bcm2048_set_rds_no_lock(struct bcm2048_device *bdev, u8 rds_on) memset(&bdev->rds_info, 0, sizeof(bdev->rds_info)); } - err = bcm2048_send_command(bdev, BCM2048_I2C_FM_RDS_SYSTEM, - bdev->cache_fm_rds_system); - - return err; + return bcm2048_send_command(bdev, BCM2048_I2C_FM_RDS_SYSTEM, + bdev->cache_fm_rds_system); } static int bcm2048_get_rds_no_lock(struct bcm2048_device *bdev) @@ -1834,9 +1832,7 @@ static int bcm2048_deinit(struct bcm2048_device *bdev) if (err < 0) return err; - err = bcm2048_set_power_state(bdev, BCM2048_POWER_OFF); - - return err; + return bcm2048_set_power_state(bdev, BCM2048_POWER_OFF); } /* @@ -1995,9 +1991,7 @@ static ssize_t bcm2048_##prop##_read(struct device *dev, \ \ value = bcm2048_get_##prop(bdev); \ \ - value = sprintf(buf, mask "\n", value); \ - \ - return value; \ + return sprintf(buf, mask "\n", value); \ } #define DEFINE_SYSFS_PROPERTY(prop, signal, size, mask, check) \ diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c index 692ba3e..fedeb3c 100644 --- a/drivers/staging/media/cxd2099/cxd2099.c +++ b/drivers/staging/media/cxd2099/cxd2099.c @@ -660,7 +660,7 @@ static int write_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount) struct cxd *ci = ca->data; mutex_lock(&ci->lock); - printk(kern_INFO "write_data %d\n", ecount); + dev_info(&ci->i2c->dev, "write_data %d\n", ecount); write_reg(ci, 0x0d, ecount>>8); write_reg(ci, 0x0e, ecount&0xff); write_block(ci, 0x11, ebuf, ecount); diff --git a/drivers/staging/media/davinci_vpfe/davinci_vpfe_user.h b/drivers/staging/media/davinci_vpfe/davinci_vpfe_user.h index f4f35c9..d3f34f9 100644 --- a/drivers/staging/media/davinci_vpfe/davinci_vpfe_user.h +++ b/drivers/staging/media/davinci_vpfe/davinci_vpfe_user.h @@ -544,41 +544,41 @@ struct vpfe_isif_raw_config { /* IPIPE module configurations */ /* IPIPE input configuration */ -#define VPFE_IPIPE_INPUT_CONFIG (1 << 0) +#define VPFE_IPIPE_INPUT_CONFIG BIT(0) /* LUT based Defect Pixel Correction */ -#define VPFE_IPIPE_LUTDPC (1 << 1) +#define VPFE_IPIPE_LUTDPC BIT(1) /* On the fly (OTF) Defect Pixel Correction */ -#define VPFE_IPIPE_OTFDPC (1 << 2) +#define VPFE_IPIPE_OTFDPC BIT(2) /* Noise Filter - 1 */ -#define VPFE_IPIPE_NF1 (1 << 3) +#define VPFE_IPIPE_NF1 BIT(3) /* Noise Filter - 2 */ -#define VPFE_IPIPE_NF2 (1 << 4) +#define VPFE_IPIPE_NF2 BIT(4) /* White Balance. Also a control ID */ -#define VPFE_IPIPE_WB (1 << 5) +#define VPFE_IPIPE_WB BIT(5) /* 1st RGB to RBG Blend module */ -#define VPFE_IPIPE_RGB2RGB_1 (1 << 6) +#define VPFE_IPIPE_RGB2RGB_1 BIT(6) /* 2nd RGB to RBG Blend module */ -#define VPFE_IPIPE_RGB2RGB_2 (1 << 7) +#define VPFE_IPIPE_RGB2RGB_2 BIT(7) /* Gamma Correction */ -#define VPFE_IPIPE_GAMMA (1 << 8) +#define VPFE_IPIPE_GAMMA BIT(8) /* 3D LUT color conversion */ -#define VPFE_IPIPE_3D_LUT (1 << 9) +#define VPFE_IPIPE_3D_LUT BIT(9) /* RGB to YCbCr module */ -#define VPFE_IPIPE_RGB2YUV (1 << 10) +#define VPFE_IPIPE_RGB2YUV BIT(10) /* YUV 422 conversion module */ -#define VPFE_IPIPE_YUV422_CONV (1 << 11) +#define VPFE_IPIPE_YUV422_CONV BIT(11) /* Edge Enhancement */ -#define VPFE_IPIPE_YEE (1 << 12) +#define VPFE_IPIPE_YEE BIT(12) /* Green Imbalance Correction */ -#define VPFE_IPIPE_GIC (1 << 13) +#define VPFE_IPIPE_GIC BIT(13) /* CFA Interpolation */ -#define VPFE_IPIPE_CFA (1 << 14) +#define VPFE_IPIPE_CFA BIT(14) /* Chroma Artifact Reduction */ -#define VPFE_IPIPE_CAR (1 << 15) +#define VPFE_IPIPE_CAR BIT(15) /* Chroma Gain Suppression */ -#define VPFE_IPIPE_CGS (1 << 16) +#define VPFE_IPIPE_CGS BIT(16) /* Global brightness and contrast control */ -#define VPFE_IPIPE_GBCE (1 << 17) +#define VPFE_IPIPE_GBCE BIT(17) #define VPFE_IPIPE_MAX_MODULES 18 diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.c b/drivers/staging/media/davinci_vpfe/dm365_isif.c index ae9202d..569bcdc 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_isif.c +++ b/drivers/staging/media/davinci_vpfe/dm365_isif.c @@ -146,9 +146,8 @@ enum v4l2_field vpfe_isif_get_fid(struct vpfe_device *vpfe_dev) u32 field_status; field_status = isif_read(isif->isif_cfg.base_addr, MODESET); - field_status = (field_status >> DM365_ISIF_MDFS_OFFSET) & - DM365_ISIF_MDFS_MASK; - return field_status; + return (field_status >> DM365_ISIF_MDFS_OFFSET) & + DM365_ISIF_MDFS_MASK; } static int @@ -594,8 +593,7 @@ isif_validate_raw_params(struct vpfe_isif_raw_config *params) ret = isif_validate_dfc_params(¶ms->dfc); if (ret) return ret; - ret = isif_validate_bclamp_params(¶ms->bclamp); - return ret; + return isif_validate_bclamp_params(¶ms->bclamp); } static int isif_set_params(struct v4l2_subdev *sd, void *params) diff --git a/drivers/staging/media/davinci_vpfe/dm365_resizer.c b/drivers/staging/media/davinci_vpfe/dm365_resizer.c index 3cd56cc..1286626 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_resizer.c +++ b/drivers/staging/media/davinci_vpfe/dm365_resizer.c @@ -128,7 +128,7 @@ resizer_configure_passthru(struct vpfe_resizer_device *resizer, int bypass) static void configure_resizer_out_params(struct vpfe_resizer_device *resizer, int index, void *output_spec, unsigned char partial, - unsigned flag) + unsigned int flag) { struct resizer_params *param = &resizer->config; struct v4l2_mbus_framefmt *outformat; diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c index 3319fb8..8be9f85 100644 --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c @@ -37,7 +37,7 @@ static struct media_entity *vpfe_get_input_entity struct media_pad *remote; remote = media_entity_remote_pad(&vpfe_dev->vpfe_isif.pads[0]); - if (remote == NULL) { + if (!remote) { pr_err("Invalid media connection to isif/ccdc\n"); return NULL; } @@ -54,7 +54,7 @@ static int vpfe_update_current_ext_subdev(struct vpfe_video_device *video) int i; remote = media_entity_remote_pad(&vpfe_dev->vpfe_isif.pads[0]); - if (remote == NULL) { + if (!remote) { pr_err("Invalid media connection to isif/ccdc\n"); return -EINVAL; } @@ -107,7 +107,7 @@ __vpfe_video_get_format(struct vpfe_video_device *video, int ret; subdev = vpfe_video_remote_subdev(video, &pad); - if (subdev == NULL) + if (!subdev) return -EINVAL; fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; @@ -236,7 +236,7 @@ static int vpfe_video_validate_pipeline(struct vpfe_pipeline *pipe) * format of the connected pad. */ subdev = vpfe_video_remote_subdev(pipe->outputs[0], NULL); - if (subdev == NULL) + if (!subdev) return -EPIPE; while (1) { @@ -413,7 +413,7 @@ static int vpfe_open(struct file *file) /* Allocate memory for the file handle object */ handle = kzalloc(sizeof(struct vpfe_fh), GFP_KERNEL); - if (handle == NULL) + if (!handle) return -ENOMEM; v4l2_fh_init(&handle->vfh, &video->video_dev); @@ -683,14 +683,14 @@ static int vpfe_enum_fmt(struct file *file, void *priv, } /* get the remote pad */ remote = media_entity_remote_pad(&video->pad); - if (remote == NULL) { + if (!remote) { v4l2_err(&vpfe_dev->v4l2_dev, "invalid remote pad for video node\n"); return -EINVAL; } /* get the remote subdev */ subdev = vpfe_video_remote_subdev(video, NULL); - if (subdev == NULL) { + if (!subdev) { v4l2_err(&vpfe_dev->v4l2_dev, "invalid remote subdev for video node\n"); return -EINVAL; diff --git a/drivers/staging/media/lirc/lirc_bt829.c b/drivers/staging/media/lirc/lirc_bt829.c index 44f5655..04d881b 100644 --- a/drivers/staging/media/lirc/lirc_bt829.c +++ b/drivers/staging/media/lirc/lirc_bt829.c @@ -120,7 +120,7 @@ int init_module(void) int rc; pdev = do_pci_probe(); - if (pdev == NULL) + if (!pdev) return -ENODEV; rc = pci_enable_device(pdev); @@ -163,7 +163,6 @@ err_put_dev: return rc; } - void cleanup_module(void) { struct pci_dev *pdev = to_pci_dev(atir_driver.dev); @@ -174,7 +173,6 @@ void cleanup_module(void) pci_dev_put(pdev); } - static int atir_init_start(void) { pci_addr_lin = ioremap(pci_addr_phys + DATA_PCI_OFF, 0x400); @@ -187,10 +185,9 @@ static int atir_init_start(void) static void cycle_delay(int cycle) { - udelay(WAIT_CYCLE*cycle); + udelay(WAIT_CYCLE * cycle); } - static int poll_main(void) { unsigned char status_high, status_low; diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c index ff1926c..198a805 100644 --- a/drivers/staging/media/lirc/lirc_imon.c +++ b/drivers/staging/media/lirc/lirc_imon.c @@ -32,7 +32,6 @@ #include <media/lirc.h> #include <media/lirc_dev.h> - #define MOD_AUTHOR "Venky Raju <dev@venky.ws>" #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display" #define MOD_NAME "lirc_imon" @@ -212,7 +211,6 @@ static void deregister_from_lirc(struct imon_context *context) else dev_info(&context->usbdev->dev, "Deregistered iMON driver (minor:%d)\n", minor); - } /** @@ -429,7 +427,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf, do { memcpy(context->usb_tx_buf, context->tx.data_buf + offset, 7); - context->usb_tx_buf[7] = (unsigned char) seq; + context->usb_tx_buf[7] = (unsigned char)seq; retval = send_packet(context); if (retval) { @@ -447,7 +445,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf, if (context->vfd_proto_6p) { /* Send packet #6 */ memcpy(context->usb_tx_buf, &vfd_packet6, sizeof(vfd_packet6)); - context->usb_tx_buf[7] = (unsigned char) seq; + context->usb_tx_buf[7] = (unsigned char)seq; retval = send_packet(context); if (retval) dev_err(&context->usbdev->dev, @@ -563,7 +561,7 @@ static void submit_data(struct imon_context *context) value |= PULSE_BIT; for (i = 0; i < 4; ++i) - buf[i] = value>>(i*8); + buf[i] = value >> (i * 8); lirc_buffer_write(context->driver->rbuf, buf); wake_up(&context->driver->rbuf->wait_poll); @@ -589,7 +587,7 @@ static void imon_incoming_packet(struct imon_context *context, if (len != 8) { dev_warn(dev, "imon %s: invalid incoming packet size (len = %d, intf%d)\n", - __func__, len, intf); + __func__, len, intf); return; } @@ -704,7 +702,7 @@ static int imon_probe(struct usb_interface *interface, /* prevent races probing devices w/multiple interfaces */ mutex_lock(&driver_lock); - context = kzalloc(sizeof(struct imon_context), GFP_KERNEL); + context = kzalloc(sizeof(*context), GFP_KERNEL); if (!context) goto driver_unlock; @@ -784,11 +782,11 @@ static int imon_probe(struct usb_interface *interface, __func__, vfd_proto_6p); } - driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL); + driver = kzalloc(sizeof(*driver), GFP_KERNEL); if (!driver) goto free_context; - rbuf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL); + rbuf = kmalloc(sizeof(*rbuf), GFP_KERNEL); if (!rbuf) goto free_driver; @@ -797,16 +795,11 @@ static int imon_probe(struct usb_interface *interface, goto free_rbuf; } rx_urb = usb_alloc_urb(0, GFP_KERNEL); - if (!rx_urb) { - dev_err(dev, "%s: usb_alloc_urb failed for IR urb\n", __func__); + if (!rx_urb) goto free_lirc_buf; - } tx_urb = usb_alloc_urb(0, GFP_KERNEL); - if (!tx_urb) { - dev_err(dev, "%s: usb_alloc_urb failed for display urb\n", - __func__); + if (!tx_urb) goto free_rx_urb; - } mutex_init(&context->ctx_lock); context->vfd_proto_6p = vfd_proto_6p; @@ -835,7 +828,7 @@ static int imon_probe(struct usb_interface *interface, } dev_info(dev, "Registered iMON driver (lirc minor: %d)\n", - lirc_minor); + lirc_minor); /* Needed while unregistering! */ driver->minor = lirc_minor; @@ -856,8 +849,8 @@ static int imon_probe(struct usb_interface *interface, context->display = 1; usb_fill_int_urb(context->rx_urb, context->usbdev, - usb_rcvintpipe(context->usbdev, - context->rx_endpoint->bEndpointAddress), + usb_rcvintpipe(context->usbdev, + context->rx_endpoint->bEndpointAddress), context->usb_rx_buf, sizeof(context->usb_rx_buf), usb_rx_callback, context, context->rx_endpoint->bInterval); @@ -882,7 +875,7 @@ static int imon_probe(struct usb_interface *interface, } dev_info(dev, "iMON device (%04x:%04x, intf%d) on usb<%d:%d> initialized\n", - vendor, product, ifnum, usbdev->bus->busnum, usbdev->devnum); + vendor, product, ifnum, usbdev->bus->busnum, usbdev->devnum); /* Everything went fine. Just unlock and return retval (with is 0) */ mutex_unlock(&context->ctx_lock); @@ -973,8 +966,8 @@ static int imon_resume(struct usb_interface *intf) struct imon_context *context = usb_get_intfdata(intf); usb_fill_int_urb(context->rx_urb, context->usbdev, - usb_rcvintpipe(context->usbdev, - context->rx_endpoint->bEndpointAddress), + usb_rcvintpipe(context->usbdev, + context->rx_endpoint->bEndpointAddress), context->usb_rx_buf, sizeof(context->usb_rx_buf), usb_rx_callback, context, context->rx_endpoint->bInterval); diff --git a/drivers/staging/media/lirc/lirc_parallel.c b/drivers/staging/media/lirc/lirc_parallel.c index 3906ac6..64d99ec 100644 --- a/drivers/staging/media/lirc/lirc_parallel.c +++ b/drivers/staging/media/lirc/lirc_parallel.c @@ -163,12 +163,12 @@ static unsigned int init_lirc_timer(void) if (count >= 1000 && timeelapsed > 0) { if (default_timer == 0) { /* autodetect timer */ - newtimer = (1000000*count)/timeelapsed; + newtimer = (1000000 * count) / timeelapsed; pr_info("%u Hz timer detected\n", newtimer); return newtimer; } - newtimer = (1000000*count)/timeelapsed; - if (abs(newtimer - default_timer) > default_timer/10) { + newtimer = (1000000 * count) / timeelapsed; + if (abs(newtimer - default_timer) > default_timer / 10) { /* bad timer */ pr_notice("bad timer: %u Hz\n", newtimer); pr_notice("using default timer: %u Hz\n", diff --git a/drivers/staging/media/lirc/lirc_sasem.c b/drivers/staging/media/lirc/lirc_sasem.c index 2218d00..4678ae1 100644 --- a/drivers/staging/media/lirc/lirc_sasem.c +++ b/drivers/staging/media/lirc/lirc_sasem.c @@ -47,7 +47,6 @@ #include <media/lirc.h> #include <media/lirc_dev.h> - #define MOD_AUTHOR "Oliver Stabel <oliver.stabel@gmx.de>, " \ "Tim Davies <tim@opensystems.net.au>" #define MOD_DESC "USB Driver for Sasem Remote Controller V1.1" @@ -73,7 +72,7 @@ static void usb_tx_callback(struct urb *urb); /* VFD file_operations function prototypes */ static int vfd_open(struct inode *inode, struct file *file); -static long vfd_ioctl(struct file *file, unsigned cmd, unsigned long arg); +static long vfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg); static int vfd_close(struct inode *inode, struct file *file); static ssize_t vfd_write(struct file *file, const char __user *buf, size_t n_bytes, loff_t *pos); @@ -86,7 +85,6 @@ static void ir_close(void *data); #define SASEM_DATA_BUF_SZ 32 struct sasem_context { - struct usb_device *dev; int vfd_isopen; /* VFD port has been opened */ unsigned int vfd_contrast; /* VFD contrast */ @@ -156,7 +154,6 @@ static int debug; /*** M O D U L E C O D E ***/ - MODULE_AUTHOR(MOD_AUTHOR); MODULE_DESCRIPTION(MOD_DESC); MODULE_LICENSE("GPL"); @@ -186,7 +183,6 @@ static void deregister_from_lirc(struct sasem_context *context) else dev_info(&context->dev->dev, "Deregistered Sasem driver (minor:%d)\n", minor); - } /** @@ -243,7 +239,7 @@ exit: * Called when the VFD device (e.g. /dev/usb/lcd) * is closed by the application. */ -static long vfd_ioctl(struct file *file, unsigned cmd, unsigned long arg) +static long vfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct sasem_context *context; @@ -297,7 +293,6 @@ static int vfd_close(struct inode *inode, struct file *file) context->vfd_isopen = 0; dev_info(&context->dev->dev, "VFD port closed\n"); if (!context->dev_present && !context->ir_isopen) { - /* Device disconnected before close and IR port is * not open. If IR port is open, context will be * deleted by ir_close. */ @@ -546,9 +541,7 @@ static void ir_close(void *data) * at disconnect time, so do it now. */ deregister_from_lirc(context); - if (!context->vfd_isopen) { - mutex_unlock(&context->ctx_lock); delete_context(context); return; @@ -633,7 +626,6 @@ static void usb_rx_callback(struct urb *urb) return; switch (urb->status) { - case -ENOENT: /* usbcore unlink successful! */ return; @@ -651,8 +643,6 @@ static void usb_rx_callback(struct urb *urb) usb_submit_urb(context->rx_urb, GFP_ATOMIC); } - - /** * Callback function for USB core API: Probe */ @@ -709,7 +699,6 @@ static int sasem_probe(struct usb_interface *interface, } else if (!vfd_ep_found && usb_endpoint_is_int_out(ep)) { - tx_endpoint = ep; vfd_ep_found = 1; if (debug) @@ -735,17 +724,17 @@ static int sasem_probe(struct usb_interface *interface, /* Allocate memory */ alloc_status = 0; - context = kzalloc(sizeof(struct sasem_context), GFP_KERNEL); + context = kzalloc(sizeof(*context), GFP_KERNEL); if (!context) { alloc_status = 1; goto alloc_status_switch; } - driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL); + driver = kzalloc(sizeof(*driver), GFP_KERNEL); if (!driver) { alloc_status = 2; goto alloc_status_switch; } - rbuf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL); + rbuf = kmalloc(sizeof(*rbuf), GFP_KERNEL); if (!rbuf) { alloc_status = 3; goto alloc_status_switch; @@ -758,17 +747,12 @@ static int sasem_probe(struct usb_interface *interface, } rx_urb = usb_alloc_urb(0, GFP_KERNEL); if (!rx_urb) { - dev_err(&interface->dev, - "%s: usb_alloc_urb failed for IR urb\n", __func__); alloc_status = 5; goto alloc_status_switch; } if (vfd_ep_found) { tx_urb = usb_alloc_urb(0, GFP_KERNEL); if (!tx_urb) { - dev_err(&interface->dev, - "%s: usb_alloc_urb failed for VFD urb", - __func__); alloc_status = 6; goto alloc_status_switch; } |