From cfafe92c1e9408190748f528a8d21d6d8678c248 Mon Sep 17 00:00:00 2001 From: Kumari Radha Date: Wed, 8 Oct 2014 12:44:57 +0530 Subject: staging: media: omap24xx: Remove unnecessary 'out of memory' message This patch removes unnecessay out of memory message fixing the following checkpach.pl warning in omap24xxcam.c: WARNING: Possible unnecessary 'out of memory' message Signed-off-by: Kumari Radha Reviewed-by: Josh Triplett Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/omap24xx/omap24xxcam.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/omap24xx/omap24xxcam.c b/drivers/staging/media/omap24xx/omap24xxcam.c index d590b3e8b70c..5ca2bf5353fe 100644 --- a/drivers/staging/media/omap24xx/omap24xxcam.c +++ b/drivers/staging/media/omap24xx/omap24xxcam.c @@ -1737,10 +1737,8 @@ static int omap24xxcam_probe(struct platform_device *pdev) int irq; cam = kzalloc(sizeof(*cam), GFP_KERNEL); - if (!cam) { - dev_err(&pdev->dev, "could not allocate memory\n"); + if (!cam) goto err; - } platform_set_drvdata(pdev, cam); -- cgit v1.2.3-59-g8ed1b From b717a65a7b3156d8b078a72559d6ae63a1b55d54 Mon Sep 17 00:00:00 2001 From: Kumari Radha Date: Wed, 8 Oct 2014 12:45:44 +0530 Subject: staging: media: omap4iss: Remove unnecessary 'out of memory' message This patch removes unnecessay out of memory message fixing the following checkpach.pl warning in iss.c: WARNING: Possible unnecessary 'out of memory' message Signed-off-by: Kumari Radha Reviewed-by: Josh Triplett Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/omap4iss/iss.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c index d548371db65a..6e9e869e5875 100644 --- a/drivers/staging/media/omap4iss/iss.c +++ b/drivers/staging/media/omap4iss/iss.c @@ -1357,10 +1357,8 @@ static int iss_probe(struct platform_device *pdev) return -EINVAL; iss = devm_kzalloc(&pdev->dev, sizeof(*iss), GFP_KERNEL); - if (!iss) { - dev_err(&pdev->dev, "Could not allocate memory\n"); + if (!iss) return -ENOMEM; - } mutex_init(&iss->iss_mutex); -- cgit v1.2.3-59-g8ed1b From d92c54f6c079988317c5c95bdd2dadf7ce71e45c Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Tue, 7 Oct 2014 23:20:07 +0530 Subject: staging: media: ompa4iss: Replace sprintf with snprintf This patch replaces sprintf with snprintf as sprintf does not check for buffer overflow. Signed-off-by: Tapasweni Pathak Reviewed-by: Josh Triplett Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/omap4iss/iss_csi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/omap4iss/iss_csi2.c b/drivers/staging/media/omap4iss/iss_csi2.c index 92c2d5b743c7..47f86b306cb6 100644 --- a/drivers/staging/media/omap4iss/iss_csi2.c +++ b/drivers/staging/media/omap4iss/iss_csi2.c @@ -1231,7 +1231,7 @@ static int csi2_init_entities(struct iss_csi2_device *csi2, const char *subname) v4l2_subdev_init(sd, &csi2_ops); sd->internal_ops = &csi2_internal_ops; - sprintf(name, "CSI2%s", subname); + snprintf(name, sizeof(name), "CSI2%s", subname); snprintf(sd->name, sizeof(sd->name), "OMAP4 ISS %s", name); sd->grp_id = 1 << 16; /* group ID for iss subdevs */ -- cgit v1.2.3-59-g8ed1b From c3cefd3c3c289e93934bba7b6c746b3d6698777c Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Wed, 8 Oct 2014 11:17:28 +0530 Subject: staging: media: cxd2009: use usleep_range() This patch fixes checkpatch.pl warning in file cxd2099.c WARNING : msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt Signed-off-by: Tapasweni Pathak Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/cxd2099/cxd2099.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c index 73e7b2c9e4a7..657ea480c6e7 100644 --- a/drivers/staging/media/cxd2099/cxd2099.c +++ b/drivers/staging/media/cxd2099/cxd2099.c @@ -527,7 +527,7 @@ static int slot_reset(struct dvb_ca_en50221 *ca, int slot) u8 val; #endif for (i = 0; i < 100; i++) { - msleep(10); + usleep_range(10000, 11000); #if 0 read_reg(ci, 0x06, &val); dev_info(&ci->i2c->dev, "%d:%02x\n", i, val); -- cgit v1.2.3-59-g8ed1b From 2129e17ef511a3682a731fdee9b678596bc32b75 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Wed, 8 Oct 2014 09:12:17 +0530 Subject: staging: media: davinci_vpfe: Replace *__iomem with __iomem * This patch fixes defective positional use of __iomem, wherever present in media: davinci_vpfe. Signed-off-by: Tapasweni Pathak Reviewed-by: Josh Triplett Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/davinci_vpfe/dm365_ipipe.h | 4 +- .../staging/media/davinci_vpfe/dm365_ipipe_hw.c | 62 +++++++++++----------- .../staging/media/davinci_vpfe/dm365_ipipe_hw.h | 58 ++++++++++---------- drivers/staging/media/davinci_vpfe/dm365_ipipeif.h | 2 +- drivers/staging/media/davinci_vpfe/dm365_isif.c | 10 ++-- drivers/staging/media/davinci_vpfe/dm365_isif.h | 6 +-- drivers/staging/media/davinci_vpfe/dm365_resizer.h | 2 +- 7 files changed, 72 insertions(+), 72 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.h b/drivers/staging/media/davinci_vpfe/dm365_ipipe.h index cf4204603eb8..d81b29e19309 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.h +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.h @@ -120,8 +120,8 @@ struct vpfe_ipipe_device { enum ipipe_input_entity input; unsigned int output; struct v4l2_ctrl_handler ctrls; - void *__iomem base_addr; - void *__iomem isp5_base_addr; + void __iomem *base_addr; + void __iomem *isp5_base_addr; struct ipipe_module_params config; }; diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c index b2daf5e63f88..e2cdbb1a0454 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c @@ -24,7 +24,7 @@ #define IPIPE_MODE_CONTINUOUS 0 #define IPIPE_MODE_SINGLE_SHOT 1 -static void ipipe_clock_enable(void *__iomem base_addr) +static void ipipe_clock_enable(void __iomem *base_addr) { /* enable IPIPE MMR for register write access */ regw_ip(base_addr, IPIPE_GCK_MMR_DEFAULT, IPIPE_GCK_MMR); @@ -34,7 +34,7 @@ static void ipipe_clock_enable(void *__iomem base_addr) } static void -rsz_set_common_params(void *__iomem rsz_base, struct resizer_params *params) +rsz_set_common_params(void __iomem *rsz_base, struct resizer_params *params) { struct rsz_common_params *rsz_common = ¶ms->rsz_common; u32 val; @@ -66,7 +66,7 @@ rsz_set_common_params(void *__iomem rsz_base, struct resizer_params *params) } static void -rsz_set_rsz_regs(void *__iomem rsz_base, unsigned int rsz_id, +rsz_set_rsz_regs(void __iomem *rsz_base, unsigned int rsz_id, struct resizer_params *params) { struct resizer_scale_param *rsc_params; @@ -171,7 +171,7 @@ rsz_set_rsz_regs(void *__iomem rsz_base, unsigned int rsz_id, /*set the registers of either RSZ0 or RSZ1 */ static void -ipipe_setup_resizer(void *__iomem rsz_base, struct resizer_params *params) +ipipe_setup_resizer(void __iomem *rsz_base, struct resizer_params *params) { /* enable MMR gate to write to Resizer */ regw_rsz(rsz_base, 1, RSZ_GCK_MMR); @@ -302,8 +302,8 @@ int config_rsz_hw(struct vpfe_resizer_device *resizer, struct resizer_params *config) { struct vpfe_device *vpfe_dev = to_vpfe_device(resizer); - void *__iomem ipipe_base = vpfe_dev->vpfe_ipipe.base_addr; - void *__iomem rsz_base = vpfe_dev->vpfe_resizer.base_addr; + void __iomem *ipipe_base = vpfe_dev->vpfe_ipipe.base_addr; + void __iomem *rsz_base = vpfe_dev->vpfe_resizer.base_addr; /* enable VPSS clock */ vpss_enable_clock(VPSS_IPIPE_CLOCK, 1); @@ -315,7 +315,7 @@ int config_rsz_hw(struct vpfe_resizer_device *resizer, } static void -rsz_set_y_address(void *__iomem rsz_base, unsigned int address, +rsz_set_y_address(void __iomem *rsz_base, unsigned int address, unsigned int offset) { u32 val; @@ -330,7 +330,7 @@ rsz_set_y_address(void *__iomem rsz_base, unsigned int address, } static void -rsz_set_c_address(void *__iomem rsz_base, unsigned int address, +rsz_set_c_address(void __iomem *rsz_base, unsigned int address, unsigned int offset) { u32 val; @@ -352,7 +352,7 @@ rsz_set_c_address(void *__iomem rsz_base, unsigned int address, * @address: the address to set */ int -resizer_set_outaddr(void *__iomem rsz_base, struct resizer_params *params, +resizer_set_outaddr(void __iomem *rsz_base, struct resizer_params *params, int resize_no, unsigned int address) { struct resizer_scale_param *rsc_param; @@ -411,7 +411,7 @@ resizer_set_outaddr(void *__iomem rsz_base, struct resizer_params *params, } void -ipipe_set_lutdpc_regs(void *__iomem base_addr, void *__iomem isp5_base_addr, +ipipe_set_lutdpc_regs(void __iomem *base_addr, void __iomem *isp5_base_addr, struct vpfe_ipipe_lutdpc *dpc) { u32 max_tbl_size = LUT_DPC_MAX_SIZE >> 1; @@ -446,7 +446,7 @@ ipipe_set_lutdpc_regs(void *__iomem base_addr, void *__iomem isp5_base_addr, } static void -set_dpc_thresholds(void *__iomem base_addr, +set_dpc_thresholds(void __iomem *base_addr, struct vpfe_ipipe_otfdpc_2_0_cfg *dpc_thr) { regw_ip(base_addr, dpc_thr->corr_thr.r & OTFDPC_DPC2_THR_MASK, @@ -467,7 +467,7 @@ set_dpc_thresholds(void *__iomem base_addr, DPC_OTF_2D_THR_B); } -void ipipe_set_otfdpc_regs(void *__iomem base_addr, +void ipipe_set_otfdpc_regs(void __iomem *base_addr, struct vpfe_ipipe_otfdpc *otfdpc) { struct vpfe_ipipe_otfdpc_2_0_cfg *dpc_2_0 = &otfdpc->alg_cfg.dpc_2_0; @@ -523,7 +523,7 @@ void ipipe_set_otfdpc_regs(void *__iomem base_addr, /* 2D Noise filter */ void -ipipe_set_d2f_regs(void *__iomem base_addr, unsigned int id, +ipipe_set_d2f_regs(void __iomem *base_addr, unsigned int id, struct vpfe_ipipe_nf *noise_filter) { @@ -571,7 +571,7 @@ ipipe_set_d2f_regs(void *__iomem base_addr, unsigned int id, (((decimal & 0x1f) | ((integer & 0x7) << 5))) /* Green Imbalance Correction */ -void ipipe_set_gic_regs(void *__iomem base_addr, struct vpfe_ipipe_gic *gic) +void ipipe_set_gic_regs(void __iomem *base_addr, struct vpfe_ipipe_gic *gic) { u32 val; @@ -609,7 +609,7 @@ void ipipe_set_gic_regs(void *__iomem base_addr, struct vpfe_ipipe_gic *gic) #define IPIPE_U13Q9(decimal, integer) \ (((decimal & 0x1ff) | ((integer & 0xf) << 9))) /* White balance */ -void ipipe_set_wb_regs(void *__iomem base_addr, struct vpfe_ipipe_wb *wb) +void ipipe_set_wb_regs(void __iomem *base_addr, struct vpfe_ipipe_wb *wb) { u32 val; @@ -635,7 +635,7 @@ void ipipe_set_wb_regs(void *__iomem base_addr, struct vpfe_ipipe_wb *wb) } /* CFA */ -void ipipe_set_cfa_regs(void *__iomem base_addr, struct vpfe_ipipe_cfa *cfa) +void ipipe_set_cfa_regs(void __iomem *base_addr, struct vpfe_ipipe_cfa *cfa) { ipipe_clock_enable(base_addr); @@ -671,7 +671,7 @@ void ipipe_set_cfa_regs(void *__iomem base_addr, struct vpfe_ipipe_cfa *cfa) } void -ipipe_set_rgb2rgb_regs(void *__iomem base_addr, unsigned int id, +ipipe_set_rgb2rgb_regs(void __iomem *base_addr, unsigned int id, struct vpfe_ipipe_rgb2rgb *rgb) { u32 offset_mask = RGB2RGB_1_OFST_MASK; @@ -724,7 +724,7 @@ ipipe_set_rgb2rgb_regs(void *__iomem base_addr, unsigned int id, } static void -ipipe_update_gamma_tbl(void *__iomem isp5_base_addr, +ipipe_update_gamma_tbl(void __iomem *isp5_base_addr, struct vpfe_ipipe_gamma_entry *table, int size, u32 addr) { int count; @@ -738,7 +738,7 @@ ipipe_update_gamma_tbl(void *__iomem isp5_base_addr, } void -ipipe_set_gamma_regs(void *__iomem base_addr, void *__iomem isp5_base_addr, +ipipe_set_gamma_regs(void __iomem *base_addr, void __iomem *isp5_base_addr, struct vpfe_ipipe_gamma *gamma) { int table_size; @@ -770,7 +770,7 @@ ipipe_set_gamma_regs(void *__iomem base_addr, void *__iomem isp5_base_addr, } void -ipipe_set_3d_lut_regs(void *__iomem base_addr, void *__iomem isp5_base_addr, +ipipe_set_3d_lut_regs(void __iomem *base_addr, void __iomem *isp5_base_addr, struct vpfe_ipipe_3d_lut *lut_3d) { struct vpfe_ipipe_3d_lut_entry *tbl; @@ -819,7 +819,7 @@ ipipe_set_3d_lut_regs(void *__iomem base_addr, void *__iomem isp5_base_addr, /* Lumina adjustments */ void -ipipe_set_lum_adj_regs(void *__iomem base_addr, struct ipipe_lum_adj *lum_adj) +ipipe_set_lum_adj_regs(void __iomem *base_addr, struct ipipe_lum_adj *lum_adj) { u32 val; @@ -834,7 +834,7 @@ ipipe_set_lum_adj_regs(void *__iomem base_addr, struct ipipe_lum_adj *lum_adj) #define IPIPE_S12Q8(decimal, integer) \ (((decimal & 0xff) | ((integer & 0xf) << 8))) -void ipipe_set_rgb2ycbcr_regs(void *__iomem base_addr, +void ipipe_set_rgb2ycbcr_regs(void __iomem *base_addr, struct vpfe_ipipe_rgb2yuv *yuv) { u32 val; @@ -866,7 +866,7 @@ void ipipe_set_rgb2ycbcr_regs(void *__iomem base_addr, /* YUV 422 conversion */ void -ipipe_set_yuv422_conv_regs(void *__iomem base_addr, +ipipe_set_yuv422_conv_regs(void __iomem *base_addr, struct vpfe_ipipe_yuv422_conv *conv) { u32 val; @@ -879,7 +879,7 @@ ipipe_set_yuv422_conv_regs(void *__iomem base_addr, } void -ipipe_set_gbce_regs(void *__iomem base_addr, void *__iomem isp5_base_addr, +ipipe_set_gbce_regs(void __iomem *base_addr, void __iomem *isp5_base_addr, struct vpfe_ipipe_gbce *gbce) { unsigned int count; @@ -906,7 +906,7 @@ ipipe_set_gbce_regs(void *__iomem base_addr, void *__iomem isp5_base_addr, } void -ipipe_set_ee_regs(void *__iomem base_addr, void *__iomem isp5_base_addr, +ipipe_set_ee_regs(void __iomem *base_addr, void __iomem *isp5_base_addr, struct vpfe_ipipe_yee *ee) { unsigned int count; @@ -950,7 +950,7 @@ ipipe_set_ee_regs(void *__iomem base_addr, void *__iomem isp5_base_addr, } /* Chromatic Artifact Correction. CAR */ -static void ipipe_set_mf(void *__iomem base_addr) +static void ipipe_set_mf(void __iomem *base_addr) { /* typ to dynamic switch */ regw_ip(base_addr, VPFE_IPIPE_CAR_DYN_SWITCH, CAR_TYP); @@ -959,7 +959,7 @@ static void ipipe_set_mf(void *__iomem base_addr) } static void -ipipe_set_gain_ctrl(void *__iomem base_addr, struct vpfe_ipipe_car *car) +ipipe_set_gain_ctrl(void __iomem *base_addr, struct vpfe_ipipe_car *car) { regw_ip(base_addr, VPFE_IPIPE_CAR_CHR_GAIN_CTRL, CAR_TYP); regw_ip(base_addr, car->hpf, CAR_HPF_TYP); @@ -975,7 +975,7 @@ ipipe_set_gain_ctrl(void *__iomem base_addr, struct vpfe_ipipe_car *car) CAR_GN2_MIN); } -void ipipe_set_car_regs(void *__iomem base_addr, struct vpfe_ipipe_car *car) +void ipipe_set_car_regs(void __iomem *base_addr, struct vpfe_ipipe_car *car) { u32 val; @@ -1010,7 +1010,7 @@ void ipipe_set_car_regs(void *__iomem base_addr, struct vpfe_ipipe_car *car) } /* Chromatic Gain Suppression */ -void ipipe_set_cgs_regs(void *__iomem base_addr, struct vpfe_ipipe_cgs *cgs) +void ipipe_set_cgs_regs(void __iomem *base_addr, struct vpfe_ipipe_cgs *cgs) { ipipe_clock_enable(base_addr); regw_ip(base_addr, cgs->en, CGS_EN); @@ -1025,12 +1025,12 @@ void ipipe_set_cgs_regs(void *__iomem base_addr, struct vpfe_ipipe_cgs *cgs) regw_ip(base_addr, cgs->h_min, CGS_GN1_H_MIN); } -void rsz_src_enable(void *__iomem rsz_base, int enable) +void rsz_src_enable(void __iomem *rsz_base, int enable) { regw_rsz(rsz_base, enable, RSZ_SRC_EN); } -int rsz_enable(void *__iomem rsz_base, int rsz_id, int enable) +int rsz_enable(void __iomem *rsz_base, int rsz_id, int enable) { if (rsz_id == RSZ_A) { regw_rsz(rsz_base, enable, RSZ_EN_A); diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.h b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.h index 81176fb9d164..2bf2f7a69173 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.h +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.h @@ -490,29 +490,29 @@ #define RSZ_RGB_TYP_SHIFT 0 #define RSZ_RGB_ALPHA_MASK 0xff -static inline u32 regr_ip(void *__iomem addr, u32 offset) +static inline u32 regr_ip(void __iomem *addr, u32 offset) { return readl(addr + offset); } -static inline void regw_ip(void *__iomem addr, u32 val, u32 offset) +static inline void regw_ip(void __iomem *addr, u32 val, u32 offset) { writel(val, addr + offset); } -static inline u32 w_ip_table(void *__iomem addr, u32 val, u32 offset) +static inline u32 w_ip_table(void __iomem *addr, u32 val, u32 offset) { writel(val, addr + offset); return val; } -static inline u32 regr_rsz(void *__iomem addr, u32 offset) +static inline u32 regr_rsz(void __iomem *addr, u32 offset) { return readl(addr + offset); } -static inline u32 regw_rsz(void *__iomem addr, u32 val, u32 offset) +static inline u32 regw_rsz(void __iomem *addr, u32 val, u32 offset) { writel(val, addr + offset); @@ -520,39 +520,39 @@ static inline u32 regw_rsz(void *__iomem addr, u32 val, u32 offset) } int config_ipipe_hw(struct vpfe_ipipe_device *ipipe); -int resizer_set_outaddr(void *__iomem rsz_base, struct resizer_params *params, +int resizer_set_outaddr(void __iomem *rsz_base, struct resizer_params *params, int resize_no, unsigned int address); -int rsz_enable(void *__iomem rsz_base, int rsz_id, int enable); -void rsz_src_enable(void *__iomem rsz_base, int enable); +int rsz_enable(void __iomem *rsz_base, int rsz_id, int enable); +void rsz_src_enable(void __iomem *rsz_base, int enable); void rsz_set_in_pix_format(unsigned char y_c); int config_rsz_hw(struct vpfe_resizer_device *resizer, struct resizer_params *config); -void ipipe_set_d2f_regs(void *__iomem base_addr, unsigned int id, +void ipipe_set_d2f_regs(void __iomem *base_addr, unsigned int id, struct vpfe_ipipe_nf *noise_filter); -void ipipe_set_rgb2rgb_regs(void *__iomem base_addr, unsigned int id, +void ipipe_set_rgb2rgb_regs(void __iomem *base_addr, unsigned int id, struct vpfe_ipipe_rgb2rgb *rgb); -void ipipe_set_yuv422_conv_regs(void *__iomem base_addr, +void ipipe_set_yuv422_conv_regs(void __iomem *base_addr, struct vpfe_ipipe_yuv422_conv *conv); -void ipipe_set_lum_adj_regs(void *__iomem base_addr, +void ipipe_set_lum_adj_regs(void __iomem *base_addr, struct ipipe_lum_adj *lum_adj); -void ipipe_set_rgb2ycbcr_regs(void *__iomem base_addr, +void ipipe_set_rgb2ycbcr_regs(void __iomem *base_addr, struct vpfe_ipipe_rgb2yuv *yuv); -void ipipe_set_lutdpc_regs(void *__iomem base_addr, - void *__iomem isp5_base_addr, struct vpfe_ipipe_lutdpc *lutdpc); -void ipipe_set_otfdpc_regs(void *__iomem base_addr, +void ipipe_set_lutdpc_regs(void __iomem *base_addr, + void __iomem *isp5_base_addr, struct vpfe_ipipe_lutdpc *lutdpc); +void ipipe_set_otfdpc_regs(void __iomem *base_addr, struct vpfe_ipipe_otfdpc *otfdpc); -void ipipe_set_3d_lut_regs(void *__iomem base_addr, - void *__iomem isp5_base_addr, struct vpfe_ipipe_3d_lut *lut_3d); -void ipipe_set_gamma_regs(void *__iomem base_addr, - void *__iomem isp5_base_addr, struct vpfe_ipipe_gamma *gamma); -void ipipe_set_ee_regs(void *__iomem base_addr, - void *__iomem isp5_base_addr, struct vpfe_ipipe_yee *ee); -void ipipe_set_gbce_regs(void *__iomem base_addr, - void *__iomem isp5_base_addr, struct vpfe_ipipe_gbce *gbce); -void ipipe_set_gic_regs(void *__iomem base_addr, struct vpfe_ipipe_gic *gic); -void ipipe_set_cfa_regs(void *__iomem base_addr, struct vpfe_ipipe_cfa *cfa); -void ipipe_set_car_regs(void *__iomem base_addr, struct vpfe_ipipe_car *car); -void ipipe_set_cgs_regs(void *__iomem base_addr, struct vpfe_ipipe_cgs *cgs); -void ipipe_set_wb_regs(void *__iomem base_addr, struct vpfe_ipipe_wb *wb); +void ipipe_set_3d_lut_regs(void __iomem *base_addr, + void __iomem *isp5_base_addr, struct vpfe_ipipe_3d_lut *lut_3d); +void ipipe_set_gamma_regs(void __iomem *base_addr, + void __iomem *isp5_base_addr, struct vpfe_ipipe_gamma *gamma); +void ipipe_set_ee_regs(void __iomem *base_addr, + void __iomem *isp5_base_addr, struct vpfe_ipipe_yee *ee); +void ipipe_set_gbce_regs(void __iomem *base_addr, + void __iomem *isp5_base_addr, struct vpfe_ipipe_gbce *gbce); +void ipipe_set_gic_regs(void __iomem *base_addr, struct vpfe_ipipe_gic *gic); +void ipipe_set_cfa_regs(void __iomem *base_addr, struct vpfe_ipipe_cfa *cfa); +void ipipe_set_car_regs(void __iomem *base_addr, struct vpfe_ipipe_car *car); +void ipipe_set_cgs_regs(void __iomem *base_addr, struct vpfe_ipipe_cgs *cgs); +void ipipe_set_wb_regs(void __iomem *base_addr, struct vpfe_ipipe_wb *wb); #endif /* _DAVINCI_VPFE_DM365_IPIPE_HW_H */ diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipeif.h b/drivers/staging/media/davinci_vpfe/dm365_ipipeif.h index 608701fc5fed..cea3d61335af 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipeif.h +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipeif.h @@ -134,7 +134,7 @@ struct vpfe_ipipeif_device { unsigned int output; struct vpfe_video_device video_in; struct v4l2_ctrl_handler ctrls; - void *__iomem ipipeif_base_addr; + void __iomem *ipipeif_base_addr; struct ipipeif_params config; int dpcm_predictor; int gain; diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.c b/drivers/staging/media/davinci_vpfe/dm365_isif.c index 0d535b062e4e..f00cd9f23227 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_isif.c +++ b/drivers/staging/media/davinci_vpfe/dm365_isif.c @@ -70,17 +70,17 @@ static const u32 isif_srggb_pattern = ISIF_COLPTN_Gb_G << ISIF_CCOLP_CP15_4 | ISIF_COLPTN_B_Mg << ISIF_CCOLP_CP17_6; -static inline u32 isif_read(void *__iomem base_addr, u32 offset) +static inline u32 isif_read(void __iomem *base_addr, u32 offset) { return readl(base_addr + offset); } -static inline void isif_write(void *__iomem base_addr, u32 val, u32 offset) +static inline void isif_write(void __iomem *base_addr, u32 val, u32 offset) { writel(val, base_addr + offset); } -static inline u32 isif_merge(void *__iomem base_addr, u32 mask, u32 val, +static inline u32 isif_merge(void __iomem *base_addr, u32 mask, u32 val, u32 offset) { u32 new_val = (isif_read(base_addr, offset) & ~mask) | (val & mask); @@ -646,7 +646,7 @@ static void isif_config_gain_offset(struct vpfe_isif_device *isif) { struct vpfe_isif_gain_offsets_adj *gain_off_ptr = &isif->isif_cfg.bayer.config_params.gain_offset; - void *__iomem base = isif->isif_cfg.base_addr; + void __iomem *base = isif->isif_cfg.base_addr; u32 val; val = ((gain_off_ptr->gain_sdram_en & 1) << GAIN_SDRAM_EN_SHIFT) | @@ -1991,7 +1991,7 @@ int vpfe_isif_init(struct vpfe_isif_device *isif, struct platform_device *pdev) struct media_entity *me = &sd->entity; static resource_size_t res_len; struct resource *res; - void *__iomem addr; + void __iomem *addr; int status; int i = 0; diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.h b/drivers/staging/media/davinci_vpfe/dm365_isif.h index 473fd2cfe350..89e814e9c0d7 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_isif.h +++ b/drivers/staging/media/davinci_vpfe/dm365_isif.h @@ -159,9 +159,9 @@ struct isif_oper_config { struct isif_params_raw bayer; enum isif_data_pack data_pack; struct isif_gain_values isif_gain_params; - void *__iomem base_addr; - void *__iomem linear_tbl0_addr; - void *__iomem linear_tbl1_addr; + void __iomem *base_addr; + void __iomem *linear_tbl0_addr; + void __iomem *linear_tbl1_addr; }; #define ISIF_PAD_SINK 0 diff --git a/drivers/staging/media/davinci_vpfe/dm365_resizer.h b/drivers/staging/media/davinci_vpfe/dm365_resizer.h index 59a79422b914..93b0f44030aa 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_resizer.h +++ b/drivers/staging/media/davinci_vpfe/dm365_resizer.h @@ -228,7 +228,7 @@ struct vpfe_resizer_device { struct dm365_resizer_device resizer_a; struct dm365_resizer_device resizer_b; struct resizer_params config; - void *__iomem base_addr; + void __iomem *base_addr; }; int vpfe_resizer_init(struct vpfe_resizer_device *vpfe_rsz, -- cgit v1.2.3-59-g8ed1b From 2c1bfc3be0fc525d95ff5983bf8ea3f2aff24d1b Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Mon, 20 Oct 2014 16:58:10 +0530 Subject: staging: media: lirc: Delete unused function tv2int The function tv2int is used to convert timeval to int. 32-bit systems using 'struct timeval' will break in the year 2038, so we have to replace that code with more appropriate types. This patch changes the lirc_imon.c file of media: lirc driver. tv2int function is static and not used anywhere in this file too, so it is removed. I also build tested it. Signed-off-by: Tapasweni Pathak Acked-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/lirc/lirc_imon.c | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c index 7aca44f28c5a..e4cfbe34e56d 100644 --- a/drivers/staging/media/lirc/lirc_imon.c +++ b/drivers/staging/media/lirc/lirc_imon.c @@ -572,29 +572,6 @@ static void submit_data(struct imon_context *context) wake_up(&context->driver->rbuf->wait_poll); } -static inline int tv2int(const struct timeval *a, const struct timeval *b) -{ - int usecs = 0; - int sec = 0; - - if (b->tv_usec > a->tv_usec) { - usecs = 1000000; - sec--; - } - - usecs += a->tv_usec - b->tv_usec; - - sec += a->tv_sec - b->tv_sec; - sec *= 1000; - usecs /= 1000; - sec += usecs; - - if (sec < 0) - sec = 1000; - - return sec; -} - /** * Process the incoming packet */ -- cgit v1.2.3-59-g8ed1b From 1002a240ed72f0535f01ca88e0341ccf7c4e0b54 Mon Sep 17 00:00:00 2001 From: Aybuke Ozdemir Date: Tue, 21 Oct 2014 01:39:34 +0300 Subject: staging: media: omap24xx: Use min_t instead of min MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch focuses on fixing the following warning generated by checkpatch.pl for the file tcm825x.c: WARNÄ°NG: min() should probably be min_t(u32, tgt_xclk, TCM825X_XCLK_MAX) The changes were applied using the following coccinelle rule: @@ expression e1, e2; typedef u32; @@ -tgt_xclk = min(e1, (u32)e2); +tgt_xclk = min_t(u32, e1, e2); Signed-off-by: Aybuke Ozdemir Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/omap24xx/tcm825x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/omap24xx/tcm825x.c b/drivers/staging/media/omap24xx/tcm825x.c index 9d9ecf1fc4ae..6a1f47995a17 100644 --- a/drivers/staging/media/omap24xx/tcm825x.c +++ b/drivers/staging/media/omap24xx/tcm825x.c @@ -751,7 +751,7 @@ static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p) (2457 * tgt_fps) / MAX_FPS; tgt_xclk *= 10000; - tgt_xclk = min(tgt_xclk, (u32)TCM825X_XCLK_MAX); + tgt_xclk = min_t(u32, tgt_xclk, TCM825X_XCLK_MAX); tgt_xclk = max(tgt_xclk, (u32)TCM825X_XCLK_MIN); p->u.bt656.clock_curr = tgt_xclk; -- cgit v1.2.3-59-g8ed1b From eca6a8872a047069969a7f7ad420d819e4847be9 Mon Sep 17 00:00:00 2001 From: Aybuke Ozdemir Date: Thu, 23 Oct 2014 17:12:19 +0300 Subject: staging: media: lirc: Use pr_* instead of printk This patch focuses on fixing the following warning generated by checkpatch.pl for the file lirc_sasem.c: WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... WARNING: Prefer [subsystem eg: netdev]_cont([subsystem]dev, ... then dev_cont(dev, ... then pr_cont(... to printk(KERN_CONT ... Signed-off-by: Aybuke Ozdemir Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/lirc/lirc_sasem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/lirc/lirc_sasem.c b/drivers/staging/media/lirc/lirc_sasem.c index c20ef56202bf..05969fb451ca 100644 --- a/drivers/staging/media/lirc/lirc_sasem.c +++ b/drivers/staging/media/lirc/lirc_sasem.c @@ -583,10 +583,10 @@ static void incoming_packet(struct sasem_context *context, } if (debug) { - printk(KERN_INFO "Incoming data: "); + pr_info("Incoming data: "); for (i = 0; i < 8; ++i) - printk(KERN_CONT "%02x ", buf[i]); - printk(KERN_CONT "\n"); + pr_cont("%02x ", buf[i]); + pr_cont("\n"); } /* -- cgit v1.2.3-59-g8ed1b From 1d06bb4e9df30162d8690a26792611a141676279 Mon Sep 17 00:00:00 2001 From: Jiayi Ye Date: Sat, 25 Oct 2014 10:58:28 +0800 Subject: staging: remove unneeded parentheses around the right hand side of an assignment In assignments such as value = (FLASH_CMD_STATUS_REG_READ << 24);, parentheses are not needed. The Coccinelle semantic patch was used to find cases. @r@ identifier x; expression e1, e2; @@ - x = (e1 << e2); + x = e1 << e2; Signed-off-by: Jiayi Ye Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 2 +- drivers/staging/lustre/lustre/libcfs/debug.c | 2 +- drivers/staging/lustre/lustre/llite/rw.c | 2 +- drivers/staging/media/davinci_vpfe/dm365_resizer.c | 2 +- drivers/staging/media/omap24xx/omap24xxcam.c | 2 +- drivers/staging/ozwpan/ozhcd.c | 6 +++--- drivers/staging/rtl8188eu/hal/usb_halinit.c | 2 +- drivers/staging/rtl8723au/hal/hal_com.c | 2 +- drivers/staging/vt6655/dpc.c | 2 +- drivers/staging/xgifb/vb_setmode.c | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index 8f5cdd584f85..045f2beb41d2 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -2411,7 +2411,7 @@ kiblnd_hdev_setup_mrs(kib_hca_dev_t *hdev) goto out; } - mr_size = (1ULL << hdev->ibh_mr_shift); + mr_size = 1ULL << hdev->ibh_mr_shift; mm_size = (unsigned long)high_memory - PAGE_OFFSET; hdev->ibh_nmrs = (int)((mm_size + mr_size - 1) >> hdev->ibh_mr_shift); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index 6054eee848d3..3822e0f3faf0 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -265,7 +265,7 @@ static void ldlm_pool_recalc_slv(struct ldlm_pool *pl) * SLV. And the opposite, the more grant plan is over-consumed * (load time) the faster drops SLV. */ - slv_factor = (grant_usage << LDLM_POOL_SLV_SHIFT); + slv_factor = grant_usage << LDLM_POOL_SLV_SHIFT; do_div(slv_factor, limit); slv = slv * slv_factor; slv = dru(slv, LDLM_POOL_SLV_SHIFT, round_up); diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c index ba43b3067fa3..2c15a9e7332f 100644 --- a/drivers/staging/lustre/lustre/libcfs/debug.c +++ b/drivers/staging/lustre/lustre/libcfs/debug.c @@ -412,7 +412,7 @@ int libcfs_debug_init(unsigned long bufsize) max = TCD_MAX_PAGES; } else { max = (max / num_possible_cpus()); - max = (max << (20 - PAGE_CACHE_SHIFT)); + max = max << (20 - PAGE_CACHE_SHIFT); } rc = cfs_tracefile_init(max); diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index 1f53b9863385..613d772357ac 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -145,7 +145,7 @@ static struct ll_cl_context *ll_cl_init(struct file *file, */ io->ci_lockreq = CILR_NEVER; - pos = (vmpage->index << PAGE_CACHE_SHIFT); + pos = vmpage->index << PAGE_CACHE_SHIFT; /* Create a temp IO to serve write. */ result = cl_io_rw_init(env, io, CIT_WRITE, pos, PAGE_CACHE_SIZE); diff --git a/drivers/staging/media/davinci_vpfe/dm365_resizer.c b/drivers/staging/media/davinci_vpfe/dm365_resizer.c index 8828d6c2aab1..415502651033 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_resizer.c +++ b/drivers/staging/media/davinci_vpfe/dm365_resizer.c @@ -633,7 +633,7 @@ resizer_calculate_normal_f_div_param(struct device *dev, int input_width, if (!(val % 2)) { h1 = val; } else { - val = (input_width << 7); + val = input_width << 7; val -= rsz >> 1; val /= rsz << 1; val <<= 1; diff --git a/drivers/staging/media/omap24xx/omap24xxcam.c b/drivers/staging/media/omap24xx/omap24xxcam.c index 5ca2bf5353fe..36d81e0e114c 100644 --- a/drivers/staging/media/omap24xx/omap24xxcam.c +++ b/drivers/staging/media/omap24xx/omap24xxcam.c @@ -326,7 +326,7 @@ static int omap24xxcam_vbq_alloc_mmap_buffer(struct videobuf_buffer *vb) dma->sglen++; i++; - alloc_size = (PAGE_SIZE << order); + alloc_size = PAGE_SIZE << order; /* clear pages before giving them to user space */ memset(page_address(page), 0, alloc_size); diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c index e88045228607..8a52feb6e72e 100644 --- a/drivers/staging/ozwpan/ozhcd.c +++ b/drivers/staging/ozwpan/ozhcd.c @@ -2032,11 +2032,11 @@ static int oz_clear_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex) break; case USB_PORT_FEAT_C_CONNECTION: oz_dbg(HUB, "USB_PORT_FEAT_C_CONNECTION\n"); - clear_bits = (USB_PORT_STAT_C_CONNECTION << 16); + clear_bits = USB_PORT_STAT_C_CONNECTION << 16; break; case USB_PORT_FEAT_C_ENABLE: oz_dbg(HUB, "USB_PORT_FEAT_C_ENABLE\n"); - clear_bits = (USB_PORT_STAT_C_ENABLE << 16); + clear_bits = USB_PORT_STAT_C_ENABLE << 16; break; case USB_PORT_FEAT_C_SUSPEND: oz_dbg(HUB, "USB_PORT_FEAT_C_SUSPEND\n"); @@ -2046,7 +2046,7 @@ static int oz_clear_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex) break; case USB_PORT_FEAT_C_RESET: oz_dbg(HUB, "USB_PORT_FEAT_C_RESET\n"); - clear_bits = (USB_PORT_FEAT_C_RESET << 16); + clear_bits = USB_PORT_FEAT_C_RESET << 16; break; case USB_PORT_FEAT_TEST: oz_dbg(HUB, "USB_PORT_FEAT_TEST\n"); diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c index caf2ca3a47e7..ac6abac58bfe 100644 --- a/drivers/staging/rtl8188eu/hal/usb_halinit.c +++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c @@ -1673,7 +1673,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val) pRegToSet = RegToSet_Normal; /* 0xb972a841; */ FactorToSet = *((u8 *)val); if (FactorToSet <= 3) { - FactorToSet = (1<<(FactorToSet + 2)); + FactorToSet = 1 << (FactorToSet + 2); if (FactorToSet > 0xf) FactorToSet = 0xf; diff --git a/drivers/staging/rtl8723au/hal/hal_com.c b/drivers/staging/rtl8723au/hal/hal_com.c index f906317579bc..bf4cae20bd12 100644 --- a/drivers/staging/rtl8723au/hal/hal_com.c +++ b/drivers/staging/rtl8723au/hal/hal_com.c @@ -463,7 +463,7 @@ void rtl8723a_set_ampdu_factor(struct rtw_adapter *padapter, u8 FactorToSet) MaxAggNum = 0xF; if (FactorToSet <= 3) { - FactorToSet = (1 << (FactorToSet + 2)); + FactorToSet = 1 << (FactorToSet + 2); if (FactorToSet > MaxAggNum) FactorToSet = MaxAggNum; diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c index 344e12f1184e..eecf6f559e29 100644 --- a/drivers/staging/vt6655/dpc.c +++ b/drivers/staging/vt6655/dpc.c @@ -358,7 +358,7 @@ device_receive_frame( if ((*pbyRsr & RSR_CRCOK) != 0) pDevice->byBasicMap |= 0x01; - dwDuration = (FrameSize << 4); + dwDuration = FrameSize << 4; dwDuration /= acbyRxRate[*pbyRxRate%MAX_RATE]; if (*pbyRxRate <= RATE_11M) { if (*pbyRxSts & 0x01) { diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index d5f49d2a8db3..1f6f699e238c 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -4135,7 +4135,7 @@ static void XGI_SetGroup4(unsigned short ModeIdIndex, tempax -= 1; temp = (tempax & 0xFF00) >> 8; - temp = ((temp & 0x0003) << 4); + temp = (temp & 0x0003) << 4; xgifb_reg_set(pVBInfo->Part4Port, 0x1E, temp); temp = (tempax & 0x00FF); xgifb_reg_set(pVBInfo->Part4Port, 0x1D, temp); -- cgit v1.2.3-59-g8ed1b From be4aa8157c981a8bb9634b886bf1180f97205259 Mon Sep 17 00:00:00 2001 From: Aya Mahfouz Date: Sun, 26 Oct 2014 19:59:43 +0200 Subject: staging: media: lirc: lirc_zilog.c: replace custom print macros with dev_* and pr_* This patch removes the custom printk macros dprintk, zilog_notify, zilog_error, and zilog_info. All the calls to these macros were replaced by dev_dbg, dev_notice, dev_err, and dev_info respectively whenever possible. There were cases in which pr_debug, pr_notice, pr_err and pr_info were used. It was when the calling function did not provide an appropiate dev variable. Applying this patch will trigger the out of memory checkpatch warning for two lines. It will be fixed in a separate patch. Signed-off-by: Aya Mahfouz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/lirc/lirc_zilog.c | 139 ++++++++++++++++---------------- 1 file changed, 68 insertions(+), 71 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c index 567feba0011c..11a7cb128d9e 100644 --- a/drivers/staging/media/lirc/lirc_zilog.c +++ b/drivers/staging/media/lirc/lirc_zilog.c @@ -152,23 +152,12 @@ struct tx_data_struct { static struct tx_data_struct *tx_data; static struct mutex tx_data_lock; -#define zilog_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, \ - ## args) -#define zilog_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) -#define zilog_info(s, args...) printk(KERN_INFO KBUILD_MODNAME ": " s, ## args) /* module parameters */ static bool debug; /* debug output */ static bool tx_only; /* only handle the IR Tx function */ static int minor = -1; /* minor number */ -#define dprintk(fmt, args...) \ - do { \ - if (debug) \ - printk(KERN_DEBUG KBUILD_MODNAME ": " fmt, \ - ## args); \ - } while (0) - /* struct IR reference counting */ static struct IR *get_ir_device(struct IR *ir, bool ir_devices_lock_held) @@ -333,7 +322,7 @@ static int add_to_buf(struct IR *ir) struct IR_tx *tx; if (lirc_buffer_full(rbuf)) { - dprintk("buffer overflow\n"); + dev_dbg(ir->l.dev, "buffer overflow\n"); return -EOVERFLOW; } @@ -379,16 +368,17 @@ static int add_to_buf(struct IR *ir) */ ret = i2c_master_send(rx->c, sendbuf, 1); if (ret != 1) { - zilog_error("i2c_master_send failed with %d\n", ret); + dev_err(ir->l.dev, "i2c_master_send failed with %d\n", + ret); if (failures >= 3) { mutex_unlock(&ir->ir_lock); - zilog_error("unable to read from the IR chip " + dev_err(ir->l.dev, "unable to read from the IR chip " "after 3 resets, giving up\n"); break; } /* Looks like the chip crashed, reset it */ - zilog_error("polling the IR receiver chip failed, " + dev_err(ir->l.dev, "polling the IR receiver chip failed, " "trying reset\n"); set_current_state(TASK_UNINTERRUPTIBLE); @@ -415,13 +405,14 @@ static int add_to_buf(struct IR *ir) ret = i2c_master_recv(rx->c, keybuf, sizeof(keybuf)); mutex_unlock(&ir->ir_lock); if (ret != sizeof(keybuf)) { - zilog_error("i2c_master_recv failed with %d -- " + dev_err(ir->l.dev, "i2c_master_recv failed with %d -- " "keeping last read buffer\n", ret); } else { rx->b[0] = keybuf[3]; rx->b[1] = keybuf[4]; rx->b[2] = keybuf[5]; - dprintk("key (0x%02x/0x%02x)\n", rx->b[0], rx->b[1]); + dev_dbg(ir->l.dev, "key (0x%02x/0x%02x)\n", + rx->b[0], rx->b[1]); } /* key pressed ? */ @@ -472,7 +463,7 @@ static int lirc_thread(void *arg) struct IR *ir = arg; struct lirc_buffer *rbuf = ir->l.rbuf; - dprintk("poll thread started\n"); + dev_dbg(ir->l.dev, "poll thread started\n"); while (!kthread_should_stop()) { set_current_state(TASK_INTERRUPTIBLE); @@ -500,7 +491,7 @@ static int lirc_thread(void *arg) wake_up_interruptible(&rbuf->wait_poll); } - dprintk("poll thread ended\n"); + dev_dbg(ir->l.dev, "poll thread ended\n"); return 0; } @@ -644,7 +635,7 @@ static int get_key_data(unsigned char *buf, return -EPROTO; corrupt: - zilog_error("firmware is corrupt\n"); + pr_err("firmware is corrupt\n"); return -EFAULT; } @@ -662,10 +653,11 @@ static int send_data_block(struct IR_tx *tx, unsigned char *data_block) buf[0] = (unsigned char)(i + 1); for (j = 0; j < tosend; ++j) buf[1 + j] = data_block[i + j]; - dprintk("%*ph", 5, buf); + dev_dbg(tx->ir->l.dev, "%*ph", 5, buf); ret = i2c_master_send(tx->c, buf, tosend + 1); if (ret != tosend + 1) { - zilog_error("i2c_master_send failed with %d\n", ret); + dev_err(tx->ir->l.dev, "i2c_master_send failed with %d\n", + ret); return ret < 0 ? ret : -EFAULT; } i += tosend; @@ -689,7 +681,7 @@ static int send_boot_data(struct IR_tx *tx) buf[1] = 0x20; ret = i2c_master_send(tx->c, buf, 2); if (ret != 2) { - zilog_error("i2c_master_send failed with %d\n", ret); + dev_err(tx->ir->l.dev, "i2c_master_send failed with %d\n", ret); return ret < 0 ? ret : -EFAULT; } @@ -706,21 +698,22 @@ static int send_boot_data(struct IR_tx *tx) } if (ret != 1) { - zilog_error("i2c_master_send failed with %d\n", ret); + dev_err(tx->ir->l.dev, "i2c_master_send failed with %d\n", ret); return ret < 0 ? ret : -EFAULT; } /* Here comes the firmware version... (hopefully) */ ret = i2c_master_recv(tx->c, buf, 4); if (ret != 4) { - zilog_error("i2c_master_recv failed with %d\n", ret); + dev_err(tx->ir->l.dev, "i2c_master_recv failed with %d\n", ret); return 0; } if ((buf[0] != 0x80) && (buf[0] != 0xa0)) { - zilog_error("unexpected IR TX init response: %02x\n", buf[0]); + dev_err(tx->ir->l.dev, "unexpected IR TX init response: %02x\n", + buf[0]); return 0; } - zilog_notify("Zilog/Hauppauge IR blaster firmware version " + dev_notice(tx->ir->l.dev, "Zilog/Hauppauge IR blaster firmware version " "%d.%d.%d loaded\n", buf[1], buf[2], buf[3]); return 0; @@ -738,7 +731,7 @@ static void fw_unload_locked(void) vfree(tx_data); tx_data = NULL; - dprintk("successfully unloaded IR blaster firmware\n"); + pr_debug("successfully unloaded IR blaster firmware\n"); } } @@ -768,17 +761,17 @@ static int fw_load(struct IR_tx *tx) /* Request codeset data file */ ret = request_firmware(&fw_entry, "haup-ir-blaster.bin", tx->ir->l.dev); if (ret != 0) { - zilog_error("firmware haup-ir-blaster.bin not available (%d)\n", + dev_err(tx->ir->l.dev, "firmware haup-ir-blaster.bin not available (%d)\n", ret); ret = ret < 0 ? ret : -EFAULT; goto out; } - dprintk("firmware of size %zu loaded\n", fw_entry->size); + dev_dbg(tx->ir->l.dev, "firmware of size %zu loaded\n", fw_entry->size); /* Parse the file */ tx_data = vmalloc(sizeof(*tx_data)); if (tx_data == NULL) { - zilog_error("out of memory\n"); + dev_err(tx->ir->l.dev, "out of memory\n"); release_firmware(fw_entry); ret = -ENOMEM; goto out; @@ -788,7 +781,7 @@ static int fw_load(struct IR_tx *tx) /* Copy the data so hotplug doesn't get confused and timeout */ tx_data->datap = vmalloc(fw_entry->size); if (tx_data->datap == NULL) { - zilog_error("out of memory\n"); + dev_err(tx->ir->l.dev, "out of memory\n"); release_firmware(fw_entry); vfree(tx_data); ret = -ENOMEM; @@ -803,7 +796,7 @@ static int fw_load(struct IR_tx *tx) if (!read_uint8(&data, tx_data->endp, &version)) goto corrupt; if (version != 1) { - zilog_error("unsupported code set file version (%u, expected" + dev_err(tx->ir->l.dev, "unsupported code set file version (%u, expected" "1) -- please upgrade to a newer driver", version); fw_unload_locked(); @@ -820,7 +813,8 @@ static int fw_load(struct IR_tx *tx) &tx_data->num_code_sets)) goto corrupt; - dprintk("%u IR blaster codesets loaded\n", tx_data->num_code_sets); + dev_dbg(tx->ir->l.dev, "%u IR blaster codesets loaded\n", + tx_data->num_code_sets); tx_data->code_sets = vmalloc( tx_data->num_code_sets * sizeof(char *)); @@ -884,7 +878,7 @@ static int fw_load(struct IR_tx *tx) goto out; corrupt: - zilog_error("firmware is corrupt\n"); + dev_err(tx->ir->l.dev, "firmware is corrupt\n"); fw_unload_locked(); ret = -EFAULT; @@ -904,9 +898,9 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n, unsigned int m; DECLARE_WAITQUEUE(wait, current); - dprintk("read called\n"); + dev_dbg(ir->l.dev, "read called\n"); if (n % rbuf->chunk_size) { - dprintk("read result = -EINVAL\n"); + dev_dbg(ir->l.dev, "read result = -EINVAL\n"); return -EINVAL; } @@ -950,7 +944,7 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n, unsigned char buf[MAX_XFER_SIZE]; if (rbuf->chunk_size > sizeof(buf)) { - zilog_error("chunk_size is too big (%d)!\n", + dev_err(ir->l.dev, "chunk_size is too big (%d)!\n", rbuf->chunk_size); ret = -EINVAL; break; @@ -964,7 +958,7 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n, retries++; } if (retries >= 5) { - zilog_error("Buffer read failed!\n"); + dev_err(ir->l.dev, "Buffer read failed!\n"); ret = -EIO; } } @@ -974,7 +968,8 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n, put_ir_rx(rx, false); set_current_state(TASK_RUNNING); - dprintk("read result = %d (%s)\n", ret, ret ? "Error" : "OK"); + dev_dbg(ir->l.dev, "read result = %d (%s)\n", + ret, ret ? "Error" : "OK"); return ret ? ret : written; } @@ -990,7 +985,7 @@ static int send_code(struct IR_tx *tx, unsigned int code, unsigned int key) ret = get_key_data(data_block, code, key); if (ret == -EPROTO) { - zilog_error("failed to get data for code %u, key %u -- check " + dev_err(tx->ir->l.dev, "failed to get data for code %u, key %u -- check " "lircd.conf entries\n", code, key); return ret; } else if (ret != 0) @@ -1006,7 +1001,7 @@ static int send_code(struct IR_tx *tx, unsigned int code, unsigned int key) buf[1] = 0x40; ret = i2c_master_send(tx->c, buf, 2); if (ret != 2) { - zilog_error("i2c_master_send failed with %d\n", ret); + dev_err(tx->ir->l.dev, "i2c_master_send failed with %d\n", ret); return ret < 0 ? ret : -EFAULT; } @@ -1019,18 +1014,18 @@ static int send_code(struct IR_tx *tx, unsigned int code, unsigned int key) } if (ret != 1) { - zilog_error("i2c_master_send failed with %d\n", ret); + dev_err(tx->ir->l.dev, "i2c_master_send failed with %d\n", ret); return ret < 0 ? ret : -EFAULT; } /* Send finished download? */ ret = i2c_master_recv(tx->c, buf, 1); if (ret != 1) { - zilog_error("i2c_master_recv failed with %d\n", ret); + dev_err(tx->ir->l.dev, "i2c_master_recv failed with %d\n", ret); return ret < 0 ? ret : -EFAULT; } if (buf[0] != 0xA0) { - zilog_error("unexpected IR TX response #1: %02x\n", + dev_err(tx->ir->l.dev, "unexpected IR TX response #1: %02x\n", buf[0]); return -EFAULT; } @@ -1040,7 +1035,7 @@ static int send_code(struct IR_tx *tx, unsigned int code, unsigned int key) buf[1] = 0x80; ret = i2c_master_send(tx->c, buf, 2); if (ret != 2) { - zilog_error("i2c_master_send failed with %d\n", ret); + dev_err(tx->ir->l.dev, "i2c_master_send failed with %d\n", ret); return ret < 0 ? ret : -EFAULT; } @@ -1050,7 +1045,7 @@ static int send_code(struct IR_tx *tx, unsigned int code, unsigned int key) * going to skip this whole mess and say we're done on the HD PVR */ if (!tx->post_tx_ready_poll) { - dprintk("sent code %u, key %u\n", code, key); + dev_dbg(tx->ir->l.dev, "sent code %u, key %u\n", code, key); return 0; } @@ -1066,11 +1061,11 @@ static int send_code(struct IR_tx *tx, unsigned int code, unsigned int key) ret = i2c_master_send(tx->c, buf, 1); if (ret == 1) break; - dprintk("NAK expected: i2c_master_send " + dev_dbg(tx->ir->l.dev, "NAK expected: i2c_master_send " "failed with %d (try %d)\n", ret, i+1); } if (ret != 1) { - zilog_error("IR TX chip never got ready: last i2c_master_send " + dev_err(tx->ir->l.dev, "IR TX chip never got ready: last i2c_master_send " "failed with %d\n", ret); return ret < 0 ? ret : -EFAULT; } @@ -1078,16 +1073,17 @@ static int send_code(struct IR_tx *tx, unsigned int code, unsigned int key) /* Seems to be an 'ok' response */ i = i2c_master_recv(tx->c, buf, 1); if (i != 1) { - zilog_error("i2c_master_recv failed with %d\n", ret); + dev_err(tx->ir->l.dev, "i2c_master_recv failed with %d\n", ret); return -EFAULT; } if (buf[0] != 0x80) { - zilog_error("unexpected IR TX response #2: %02x\n", buf[0]); + dev_err(tx->ir->l.dev, "unexpected IR TX response #2: %02x\n", + buf[0]); return -EFAULT; } /* Oh good, it worked */ - dprintk("sent code %u, key %u\n", code, key); + dev_dbg(tx->ir->l.dev, "sent code %u, key %u\n", code, key); return 0; } @@ -1173,11 +1169,11 @@ static ssize_t write(struct file *filep, const char __user *buf, size_t n, */ if (ret != 0) { /* Looks like the chip crashed, reset it */ - zilog_error("sending to the IR transmitter chip " + dev_err(tx->ir->l.dev, "sending to the IR transmitter chip " "failed, trying reset\n"); if (failures >= 3) { - zilog_error("unable to send to the IR chip " + dev_err(tx->ir->l.dev, "unable to send to the IR chip " "after 3 resets, giving up\n"); mutex_unlock(&ir->ir_lock); mutex_unlock(&tx->client_lock); @@ -1212,7 +1208,7 @@ static unsigned int poll(struct file *filep, poll_table *wait) struct lirc_buffer *rbuf = ir->l.rbuf; unsigned int ret; - dprintk("poll called\n"); + dev_dbg(ir->l.dev, "poll called\n"); rx = get_ir_rx(ir); if (rx == NULL) { @@ -1220,7 +1216,7 @@ static unsigned int poll(struct file *filep, poll_table *wait) * Revisit this, if our poll function ever reports writeable * status for Tx */ - dprintk("poll result = POLLERR\n"); + dev_dbg(ir->l.dev, "poll result = POLLERR\n"); return POLLERR; } @@ -1233,7 +1229,8 @@ static unsigned int poll(struct file *filep, poll_table *wait) /* Indicate what ops could happen immediately without blocking */ ret = lirc_buffer_empty(rbuf) ? 0 : (POLLIN|POLLRDNORM); - dprintk("poll result = %s\n", ret ? "POLLIN|POLLRDNORM" : "none"); + dev_dbg(ir->l.dev, "poll result = %s\n", + ret ? "POLLIN|POLLRDNORM" : "none"); return ret; } @@ -1340,7 +1337,7 @@ static int close(struct inode *node, struct file *filep) struct IR *ir = filep->private_data; if (ir == NULL) { - zilog_error("close: no private_data attached to the file!\n"); + dev_err(ir->l.dev, "close: no private_data attached to the file!\n"); return -ENODEV; } @@ -1452,7 +1449,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) int ret; bool tx_probe = false; - dprintk("%s: %s on i2c-%d (%s), client addr=0x%02x\n", + pr_debug("%s: %s on i2c-%d (%s), client addr=0x%02x\n", __func__, id->name, adap->nr, adap->name, client->addr); /* @@ -1465,7 +1462,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) else if (tx_only) /* module option */ return -ENXIO; - zilog_info("probing IR %s on %s (i2c-%d)\n", + pr_info("probing IR %s on %s (i2c-%d)\n", tx_probe ? "Tx" : "Rx", adap->name, adap->nr); mutex_lock(&ir_devices_lock); @@ -1547,7 +1544,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) /* Proceed only if the Rx client is also ready or not needed */ if (rx == NULL && !tx_only) { - zilog_info("probe of IR Tx on %s (i2c-%d) done. Waiting" + dev_info(tx->ir->l.dev, "probe of IR Tx on %s (i2c-%d) done. Waiting" " on IR Rx.\n", adap->name, adap->nr); goto out_ok; } @@ -1586,7 +1583,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) "zilog-rx-i2c-%d", adap->nr); if (IS_ERR(rx->task)) { ret = PTR_ERR(rx->task); - zilog_error("%s: could not start IR Rx polling thread" + dev_err(tx->ir->l.dev, "%s: could not start IR Rx polling thread" "\n", __func__); /* Failed kthread, so put back the ir ref */ put_ir_device(ir, true); @@ -1599,7 +1596,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) /* Proceed only if the Tx client is also ready */ if (tx == NULL) { - zilog_info("probe of IR Rx on %s (i2c-%d) done. Waiting" + pr_info("probe of IR Rx on %s (i2c-%d) done. Waiting" " on IR Tx.\n", adap->name, adap->nr); goto out_ok; } @@ -1609,12 +1606,12 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) ir->l.minor = minor; /* module option: user requested minor number */ ir->l.minor = lirc_register_driver(&ir->l); if (ir->l.minor < 0 || ir->l.minor >= MAX_IRCTL_DEVICES) { - zilog_error("%s: \"minor\" must be between 0 and %d (%d)!\n", + dev_err(tx->ir->l.dev, "%s: \"minor\" must be between 0 and %d (%d)!\n", __func__, MAX_IRCTL_DEVICES-1, ir->l.minor); ret = -EBADRQC; goto out_put_xx; } - zilog_info("IR unit on %s (i2c-%d) registered as lirc%d and ready\n", + dev_info(ir->l.dev, "IR unit on %s (i2c-%d) registered as lirc%d and ready\n", adap->name, adap->nr, ir->l.minor); out_ok: @@ -1623,7 +1620,7 @@ out_ok: if (tx != NULL) put_ir_tx(tx, true); put_ir_device(ir, true); - zilog_info("probe of IR %s on %s (i2c-%d) done\n", + dev_info(ir->l.dev, "probe of IR %s on %s (i2c-%d) done\n", tx_probe ? "Tx" : "Rx", adap->name, adap->nr); mutex_unlock(&ir_devices_lock); return 0; @@ -1636,7 +1633,7 @@ out_put_xx: out_put_ir: put_ir_device(ir, true); out_no_ir: - zilog_error("%s: probing IR %s on %s (i2c-%d) failed with %d\n", + dev_err(ir->l.dev, "%s: probing IR %s on %s (i2c-%d) failed with %d\n", __func__, tx_probe ? "Tx" : "Rx", adap->name, adap->nr, ret); mutex_unlock(&ir_devices_lock); @@ -1647,7 +1644,7 @@ static int __init zilog_init(void) { int ret; - zilog_notify("Zilog/Hauppauge IR driver initializing\n"); + pr_notice("Zilog/Hauppauge IR driver initializing\n"); mutex_init(&tx_data_lock); @@ -1655,9 +1652,9 @@ static int __init zilog_init(void) ret = i2c_add_driver(&driver); if (ret) - zilog_error("initialization failed\n"); + pr_err("initialization failed\n"); else - zilog_notify("initialization complete\n"); + pr_notice("initialization complete\n"); return ret; } @@ -1667,7 +1664,7 @@ static void __exit zilog_exit(void) i2c_del_driver(&driver); /* if loaded */ fw_unload(); - zilog_notify("Zilog/Hauppauge IR driver unloaded\n"); + pr_notice("Zilog/Hauppauge IR driver unloaded\n"); } module_init(zilog_init); -- cgit v1.2.3-59-g8ed1b From c96bf1d6a49f0b0d38d668195ee34de52693fb87 Mon Sep 17 00:00:00 2001 From: Aya Mahfouz Date: Sun, 26 Oct 2014 19:46:00 +0200 Subject: staging: media: lirc: lirc_sir.c: use pr_debug and dev_dbg instead of dprintk This patch removes the custom printk macro dprintk and replaces most of the calls made to it by dev_dbg. pr_debug was used when the calling function did not provide the appropiate device variable. Signed-off-by: Aya Mahfouz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/lirc/lirc_sir.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/lirc/lirc_sir.c b/drivers/staging/media/lirc/lirc_sir.c index 2ee55eaf2a53..4af82e6b2d77 100644 --- a/drivers/staging/media/lirc/lirc_sir.c +++ b/drivers/staging/media/lirc/lirc_sir.c @@ -140,12 +140,6 @@ static int rx_buf[RBUF_LEN]; static unsigned int rx_tail, rx_head; static bool debug; -#define dprintk(fmt, args...) \ - do { \ - if (debug) \ - printk(KERN_DEBUG LIRC_DRIVER_NAME ": " \ - fmt, ## args); \ - } while (0) /* SECTION: Prototypes */ @@ -322,7 +316,7 @@ static void add_read_queue(int flag, unsigned long val) unsigned int new_rx_tail; int newval; - dprintk("add flag %d with val %lu\n", flag, val); + pr_debug("add flag %d with val %lu\n", flag, val); newval = val & PULSE_MASK; @@ -342,7 +336,7 @@ static void add_read_queue(int flag, unsigned long val) } new_rx_tail = (rx_tail + 1) & (RBUF_LEN - 1); if (new_rx_tail == rx_head) { - dprintk("Buffer overrun.\n"); + pr_debug("Buffer overrun.\n"); return; } rx_buf[rx_tail] = newval; @@ -439,7 +433,8 @@ static void sir_timeout(unsigned long data) outb(UART_FCR_CLEAR_RCVR, io + UART_FCR); /* determine 'virtual' pulse end: */ pulse_end = delta(&last_tv, &last_intr_tv); - dprintk("timeout add %d for %lu usec\n", last_value, pulse_end); + dev_dbg(driver.dev, "timeout add %d for %lu usec\n", + last_value, pulse_end); add_read_queue(last_value, pulse_end); last_value = 0; last_tv = last_intr_tv; @@ -479,14 +474,15 @@ static irqreturn_t sir_interrupt(int irq, void *dev_id) do_gettimeofday(&curr_tv); deltv = delta(&last_tv, &curr_tv); deltintrtv = delta(&last_intr_tv, &curr_tv); - dprintk("t %lu, d %d\n", deltintrtv, (int)data); + dev_dbg(driver.dev, "t %lu, d %d\n", + deltintrtv, (int)data); /* * if nothing came in last X cycles, * it was gap */ if (deltintrtv > TIME_CONST * threshold) { if (last_value) { - dprintk("GAP\n"); + dev_dbg(driver.dev, "GAP\n"); /* simulate signal change */ add_read_queue(last_value, deltv - -- cgit v1.2.3-59-g8ed1b From 732ba199ab07973dbc8f70903bea54cfbb63d11b Mon Sep 17 00:00:00 2001 From: Aya Mahfouz Date: Sun, 26 Oct 2014 19:39:27 +0200 Subject: staging: media: lirc: lirc_imon.c: replace printk by dev_dbg This patch replaces the calls to printk by dev_dbg. Signed-off-by: Aya Mahfouz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/lirc/lirc_imon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c index e4cfbe34e56d..e3b1fa9fd2f4 100644 --- a/drivers/staging/media/lirc/lirc_imon.c +++ b/drivers/staging/media/lirc/lirc_imon.c @@ -600,8 +600,8 @@ static void imon_incoming_packet(struct imon_context *context, if (debug) { dev_info(dev, "raw packet: "); for (i = 0; i < len; ++i) - printk("%02x ", buf[i]); - printk("\n"); + dev_dbg(dev, "%02x ", buf[i]); + dev_dbg(dev, "\n"); } /* -- cgit v1.2.3-59-g8ed1b From 72f3f59e734c88f789fca5c60707c78e6533d064 Mon Sep 17 00:00:00 2001 From: Aya Mahfouz Date: Sun, 26 Oct 2014 19:35:20 +0200 Subject: staging: media: lirc: lirc_bt829.c: replace dprintk by dev_dbg This patch removes the custom printk macro dprintk and replaces all the calls made to it by dev_dbg. Signed-off-by: Aya Mahfouz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/lirc/lirc_bt829.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/lirc/lirc_bt829.c b/drivers/staging/media/lirc/lirc_bt829.c index 4c806ba41323..44f565547179 100644 --- a/drivers/staging/media/lirc/lirc_bt829.c +++ b/drivers/staging/media/lirc/lirc_bt829.c @@ -56,11 +56,6 @@ static unsigned char do_get_bits(void); #define DRIVER_NAME "lirc_bt829" static bool debug; -#define dprintk(fmt, args...) \ - do { \ - if (debug) \ - printk(KERN_DEBUG DRIVER_NAME ": "fmt, ## args); \ - } while (0) static int atir_minor; static phys_addr_t pci_addr_phys; @@ -101,7 +96,7 @@ static int atir_add_to_buf(void *data, struct lirc_buffer *buf) status = poll_main(); key = (status >> 8) & 0xFF; if (status & 0xFF) { - dprintk("reading key %02X\n", key); + dev_dbg(atir_driver.dev, "reading key %02X\n", key); lirc_buffer_write(buf, &key); return 0; } @@ -110,13 +105,13 @@ static int atir_add_to_buf(void *data, struct lirc_buffer *buf) static int atir_set_use_inc(void *data) { - dprintk("driver is opened\n"); + dev_dbg(atir_driver.dev, "driver is opened\n"); return 0; } static void atir_set_use_dec(void *data) { - dprintk("driver is closed\n"); + dev_dbg(atir_driver.dev, "driver is closed\n"); } int init_module(void) @@ -154,7 +149,8 @@ int init_module(void) rc = atir_minor; goto err_unmap; } - dprintk("driver is registered on minor %d\n", atir_minor); + dev_dbg(atir_driver.dev, "driver is registered on minor %d\n", + atir_minor); return 0; -- cgit v1.2.3-59-g8ed1b From af3491b3709e9da39c42b8ce9a2cc17ded0926fd Mon Sep 17 00:00:00 2001 From: anuvazhayil Date: Wed, 29 Oct 2014 02:34:56 +0530 Subject: Staging: media: dm365_isif: Add blank line after variable declarations WARNING: Missing a blank line after declarations Signed-off-by: anuvazhayil Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/davinci_vpfe/dm365_isif.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.c b/drivers/staging/media/davinci_vpfe/dm365_isif.c index f00cd9f23227..fe66d98e28f4 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_isif.c +++ b/drivers/staging/media/davinci_vpfe/dm365_isif.c @@ -1602,6 +1602,7 @@ isif_pad_get_crop(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, if (crop->which == V4L2_SUBDEV_FORMAT_TRY) { struct v4l2_rect *rect; + rect = v4l2_subdev_get_try_crop(fh, ISIF_PAD_SINK); memcpy(&crop->rect, rect, sizeof(*rect)); } else { -- cgit v1.2.3-59-g8ed1b From ad1d2a4fc8676588f6fe9882235056f1c6d13b50 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Thu, 30 Oct 2014 17:02:36 +0530 Subject: staging: media: davinci_vpfe: Remove useless cast on void pointer void pointers do not need to be cast to other pointer types. The semantic patch used to find this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Build tested it. Signed-off-by: Tapasweni Pathak Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/davinci_vpfe/dm365_ipipeif.c | 4 ++-- drivers/staging/media/davinci_vpfe/dm365_resizer.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c b/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c index 6d4893b44c1f..413acbb9e948 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c @@ -421,7 +421,7 @@ static int ipipeif_get_config(struct v4l2_subdev *sd, void __user *arg) { struct vpfe_ipipeif_device *ipipeif = v4l2_get_subdevdata(sd); - struct ipipeif_params *config = (struct ipipeif_params *)arg; + struct ipipeif_params *config = arg; struct device *dev = ipipeif->subdev.v4l2_dev->dev; if (!arg) { @@ -462,7 +462,7 @@ ipipeif_get_config(struct v4l2_subdev *sd, void __user *arg) static long ipipeif_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) { - struct ipipeif_params *config = (struct ipipeif_params *)arg; + struct ipipeif_params *config = arg; int ret = -ENOIOCTLCMD; switch (cmd) { diff --git a/drivers/staging/media/davinci_vpfe/dm365_resizer.c b/drivers/staging/media/davinci_vpfe/dm365_resizer.c index 415502651033..36fc15ad190c 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_resizer.c +++ b/drivers/staging/media/davinci_vpfe/dm365_resizer.c @@ -149,7 +149,7 @@ configure_resizer_out_params(struct vpfe_resizer_device *resizer, int index, param->rsz_en[index] = DISABLE; return; } - output = (struct vpfe_rsz_output_spec *)output_spec; + output = output_spec; param->rsz_en[index] = ENABLE; if (partial) { param->rsz_rsc_param[index].h_flip = output->h_flip; @@ -1218,12 +1218,12 @@ static long resizer_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) switch (cmd) { case VIDIOC_VPFE_RSZ_S_CONFIG: - user_config = (struct vpfe_rsz_config *)arg; + user_config = arg; ret = resizer_set_configuration(resizer, user_config); break; case VIDIOC_VPFE_RSZ_G_CONFIG: - user_config = (struct vpfe_rsz_config *)arg; + user_config = arg; if (!user_config->config) { dev_err(dev, "error in VIDIOC_VPFE_RSZ_G_CONFIG\n"); return -EINVAL; -- cgit v1.2.3-59-g8ed1b From d82e62deb51b50b10736c71f06fa6ac26be3b5a3 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Thu, 30 Oct 2014 17:02:48 +0530 Subject: staging: media: lirc: Remove useless cast on void pointer void pointers do not need to be cast to other pointer types. The semantic patch used to find this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Build tested it. Signed-off-by: Tapasweni Pathak Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/lirc/lirc_igorplugusb.c | 2 +- drivers/staging/media/lirc/lirc_imon.c | 4 ++-- drivers/staging/media/lirc/lirc_sasem.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/lirc/lirc_igorplugusb.c b/drivers/staging/media/lirc/lirc_igorplugusb.c index 431d1e86ebf9..fd5d3d26b15d 100644 --- a/drivers/staging/media/lirc/lirc_igorplugusb.c +++ b/drivers/staging/media/lirc/lirc_igorplugusb.c @@ -282,7 +282,7 @@ static void send_fragment(struct igorplug *ir, struct lirc_buffer *buf, static int igorplugusb_remote_poll(void *data, struct lirc_buffer *buf) { int ret; - struct igorplug *ir = (struct igorplug *)data; + struct igorplug *ir = data; if (!ir || !ir->usbdev) /* Has the device been removed? */ return -ENODEV; diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c index e3b1fa9fd2f4..f98418cd2305 100644 --- a/drivers/staging/media/lirc/lirc_imon.c +++ b/drivers/staging/media/lirc/lirc_imon.c @@ -495,7 +495,7 @@ static int ir_open(void *data) /* prevent races with disconnect */ mutex_lock(&driver_lock); - context = (struct imon_context *)data; + context = data; /* initial IR protocol decode variables */ context->rx.count = 0; @@ -516,7 +516,7 @@ static void ir_close(void *data) { struct imon_context *context; - context = (struct imon_context *)data; + context = data; if (!context) { pr_err("%s: no context for device\n", __func__); return; diff --git a/drivers/staging/media/lirc/lirc_sasem.c b/drivers/staging/media/lirc/lirc_sasem.c index 05969fb451ca..123ddf68b587 100644 --- a/drivers/staging/media/lirc/lirc_sasem.c +++ b/drivers/staging/media/lirc/lirc_sasem.c @@ -488,7 +488,7 @@ static int ir_open(void *data) /* prevent races with disconnect */ mutex_lock(&disconnect_lock); - context = (struct sasem_context *) data; + context = data; mutex_lock(&context->ctx_lock); @@ -530,7 +530,7 @@ static void ir_close(void *data) { struct sasem_context *context; - context = (struct sasem_context *)data; + context = data; if (!context) { pr_err("%s: no context for device\n", __func__); return; -- cgit v1.2.3-59-g8ed1b From 7ede7af3fd5f92966d328586f7f42b378fa17d83 Mon Sep 17 00:00:00 2001 From: Aya Mahfouz Date: Thu, 30 Oct 2014 17:12:53 +0200 Subject: staging: media: lirc: lirc_zilog.c: remove unnecessary 'out of memory' message This patch fixes the following the following checkpatch.pl warning: Possible unnecessary 'out of memory' message The warning was issued for the file lirc_zilog.c after changing two custom printk messages to dev_err. The dev_err calls were simply removed. Signed-off-by: Aya Mahfouz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/lirc/lirc_zilog.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c index 11a7cb128d9e..52f8e91a6383 100644 --- a/drivers/staging/media/lirc/lirc_zilog.c +++ b/drivers/staging/media/lirc/lirc_zilog.c @@ -771,7 +771,6 @@ static int fw_load(struct IR_tx *tx) /* Parse the file */ tx_data = vmalloc(sizeof(*tx_data)); if (tx_data == NULL) { - dev_err(tx->ir->l.dev, "out of memory\n"); release_firmware(fw_entry); ret = -ENOMEM; goto out; @@ -781,7 +780,6 @@ static int fw_load(struct IR_tx *tx) /* Copy the data so hotplug doesn't get confused and timeout */ tx_data->datap = vmalloc(fw_entry->size); if (tx_data->datap == NULL) { - dev_err(tx->ir->l.dev, "out of memory\n"); release_firmware(fw_entry); vfree(tx_data); ret = -ENOMEM; -- cgit v1.2.3-59-g8ed1b From f80bdc281e670d17cf68b556bc566f5c447a7555 Mon Sep 17 00:00:00 2001 From: Aya Mahfouz Date: Tue, 4 Nov 2014 23:43:07 +0200 Subject: staging: media: lirc: modify print calls This patches replaces one pr_debug call by dev_dbg and changes the device used by one of the dev_err calls. Signed-off-by: Aya Mahfouz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/lirc/lirc_zilog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/staging/media') diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c index 52f8e91a6383..dca806aa439f 100644 --- a/drivers/staging/media/lirc/lirc_zilog.c +++ b/drivers/staging/media/lirc/lirc_zilog.c @@ -1447,7 +1447,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) int ret; bool tx_probe = false; - pr_debug("%s: %s on i2c-%d (%s), client addr=0x%02x\n", + dev_dbg(&client->dev, "%s: %s on i2c-%d (%s), client addr=0x%02x\n", __func__, id->name, adap->nr, adap->name, client->addr); /* @@ -1631,7 +1631,7 @@ out_put_xx: out_put_ir: put_ir_device(ir, true); out_no_ir: - dev_err(ir->l.dev, "%s: probing IR %s on %s (i2c-%d) failed with %d\n", + dev_err(&client->dev, "%s: probing IR %s on %s (i2c-%d) failed with %d\n", __func__, tx_probe ? "Tx" : "Rx", adap->name, adap->nr, ret); mutex_unlock(&ir_devices_lock); -- cgit v1.2.3-59-g8ed1b