Re: [Mjpeg-users] [PATCH 133/493] remove use of __devexit_p

2013-01-03 Thread Greg KH
On Thu, Jan 03, 2013 at 12:43:10PM +0100, Guennadi Liakhovetski wrote:
> Hi Bill
> 
> On Mon, 19 Nov 2012, Bill Pemberton wrote:
> 
> > CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
> > needed.
> 
> Doesn't this also make the use of __refdata in many locations like this
> 
> [snip]
> 
> > diff --git a/drivers/media/platform/soc_camera/sh_mobile_csi2.c 
> > b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
> > index 0528650..0d0344a 100644
> > --- a/drivers/media/platform/soc_camera/sh_mobile_csi2.c
> > +++ b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
> > @@ -382,7 +382,7 @@ static __devexit int sh_csi2_remove(struct 
> > platform_device *pdev)
> >  }
> >  
> >  static struct platform_driver __refdata sh_csi2_pdrv = {
> > -   .remove = __devexit_p(sh_csi2_remove),
> > +   .remove = sh_csi2_remove,
> > .probe  = sh_csi2_probe,
> > .driver = {
> > .name   = "sh-mobile-csi2",
> 
> superfluous? If so, I'm sure you'd be happy to make a couple more patches 
> to continue this series ;-)

Yes, it does make it superfluous.  I'm still working on getting most of
the original patches into Linus's tree, so let's wait for that to happen
first before cleaning up the reset of these :)

thanks,

greg k-h

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] [PATCH 4/8] staging: media: zoran: add debugfs

2021-09-04 Thread Greg KH
On Fri, Sep 03, 2021 at 07:15:36PM +, Corentin Labbe wrote:
> Add debugfs for displaying zoran debug and stats information.
> 
> Signed-off-by: Corentin Labbe 
> ---
>  drivers/staging/media/zoran/Kconfig  | 10 ++
>  drivers/staging/media/zoran/zoran.h  |  5 +++
>  drivers/staging/media/zoran/zoran_card.c | 39 
>  3 files changed, 54 insertions(+)
> 
> diff --git a/drivers/staging/media/zoran/Kconfig 
> b/drivers/staging/media/zoran/Kconfig
> index 7874842033ca..7d2d3c2431b1 100644
> --- a/drivers/staging/media/zoran/Kconfig
> +++ b/drivers/staging/media/zoran/Kconfig
> @@ -74,3 +74,13 @@ config VIDEO_ZORAN_AVS6EYES
>   select VIDEO_KS0127 if MEDIA_SUBDRV_AUTOSELECT
>   help
> Support for the AverMedia 6 Eyes video surveillance card.
> +
> +config VIDEO_ZORAN_DEBUG
> + bool "Enable zoran debugfs"
> + depends on VIDEO_ZORAN
> + depends on DEBUG_FS
> + help
> +   Say y to enable zoran debug file.
> +   This will create /sys/kernel/debug/CARD_NAME/debug for displaying
> +   stats and debug information.
> +
> diff --git a/drivers/staging/media/zoran/zoran.h 
> b/drivers/staging/media/zoran/zoran.h
> index b1ad2a2b914c..8c271005f14d 100644
> --- a/drivers/staging/media/zoran/zoran.h
> +++ b/drivers/staging/media/zoran/zoran.h
> @@ -18,6 +18,7 @@
>  #ifndef _BUZ_H_
>  #define _BUZ_H_
>  
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -295,6 +296,10 @@ struct zoran {
>   struct list_head queued_bufs;
>   spinlock_t queued_bufs_lock; /* Protects queued_bufs */
>   struct zr_buffer *inuse[BUZ_NUM_STAT_COM * 2];
> +#ifdef CONFIG_VIDEO_ZORAN_DEBUG
> + struct dentry *dbgfs_dir;
> + struct dentry *dbgfs_file;

No need for these, the file is never referenced and the directory can be
looked up when you want to remove it.

> +#endif
>  };
>  
>  static inline struct zoran *to_zoran(struct v4l2_device *v4l2_dev)
> diff --git a/drivers/staging/media/zoran/zoran_card.c 
> b/drivers/staging/media/zoran/zoran_card.c
> index f1465fbf98af..1ed8ed2f4f7f 100644
> --- a/drivers/staging/media/zoran/zoran_card.c
> +++ b/drivers/staging/media/zoran/zoran_card.c
> @@ -1051,6 +1051,39 @@ static const struct v4l2_ctrl_ops zoran_video_ctrl_ops 
> = {
>   .s_ctrl = zoran_video_set_ctrl,
>  };
>  
> +#ifdef CONFIG_VIDEO_ZORAN_DEBUG
> +static int zoran_debugfs_show(struct seq_file *seq, void *v)
> +{
> + struct zoran *zr = seq->private;
> +
> + seq_printf(seq, "Running mode %x\n", zr->running);
> + seq_printf(seq, "Codec mode %x\n", zr->codec_mode);
> + seq_printf(seq, "Norm %x\n", zr->norm);
> + seq_printf(seq, "Input %d\n", zr->input);
> + seq_printf(seq, "Buffersize %d\n", zr->buffer_size);
> +
> + seq_printf(seq, "V4L width %dx%d\n", zr->v4l_settings.width, 
> zr->v4l_settings.height);
> + seq_printf(seq, "V4L bytesperline %d\n", zr->v4l_settings.bytesperline);
> +
> + seq_printf(seq, "JPG decimation %u\n", zr->jpg_settings.decimation);
> + seq_printf(seq, "JPG hor_dcm %u\n", zr->jpg_settings.hor_dcm);
> + seq_printf(seq, "JPG ver_dcm %u\n", zr->jpg_settings.ver_dcm);
> + seq_printf(seq, "JPG tmp_dcm %u\n", zr->jpg_settings.tmp_dcm);
> + seq_printf(seq, "JPG odd_even %u\n", zr->jpg_settings.odd_even);
> + seq_printf(seq, "JPG crop %dx%d %d %d\n",
> + zr->jpg_settings.img_x,
> + zr->jpg_settings.img_y,
> + zr->jpg_settings.img_width,
> + zr->jpg_settings.img_height);
> +
> + seq_printf(seq, "Prepared %u\n", zr->prepared);
> + seq_printf(seq, "Queued %u\n", zr->queued);
> + return 0;
> +}
> +
> +DEFINE_SHOW_ATTRIBUTE(zoran_debugfs);
> +#endif
> +
>  /*
>   *   Scan for a Buz card (actually for the PCI controller ZR36057),
>   *   request the irq and map the io memory
> @@ -1286,6 +1319,12 @@ static int zoran_probe(struct pci_dev *pdev, const 
> struct pci_device_id *ent)
>  
>   zr->map_mode = ZORAN_MAP_MODE_RAW;
>  
> +#ifdef CONFIG_VIDEO_ZORAN_DEBUG
> + zr->dbgfs_dir = debugfs_create_dir(ZR_DEVNAME(zr), NULL);
> + zr->dbgfs_file = debugfs_create_file("debug", 0444,
> +   zr->dbgfs_dir, zr,
> +   &zoran_debugfs_fops);
> +#endif

Wait, when are you removing the files when the device is removed?

That needs to be fixed no matter what before this patch is accepted.

thanks,

greg k-h


___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] [PATCH] media: staging: zoran: refactor printk debugging function

2022-04-22 Thread Greg KH
On Thu, Apr 21, 2022 at 08:30:25PM -0400, Ian Cowan wrote:
> On Thu, Apr 21, 2022 at 06:52:04PM +0300, Dan Carpenter wrote:
> > On Thu, Apr 21, 2022 at 11:22:00AM -0400, Ian Cowan wrote:
> > > 
> > > For using the dev_dbg() macro, do you define this in the header file
> > > (i.e. for this it would be videocodec.h), or where should this be
> > > included from?
> > 
> > dev_dbg() is defined in include/linux/dev_printk.h.  Look around at how
> > it's used.  pr_debug() might be an option, but I don't know if we will
> > accept that, we prefer dev_dbg().
> > 
> > regards,
> > dan carpenter
> > 
> 
> I'm about to submit the modified patch, but I went and looked and we
> cannot use dev_dbg() because these specific drivers do not have any
> association with a device struct.

Then please fix that issue, as there is a real struct device that they
are using somewhere.  That is the correct solution as drivers should
never use pr_* calls directly.

thanks,

greg k-h


___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] [PATCH] media: staging: zoran: refactor printk debugging function

2022-04-23 Thread Greg KH
On Sat, Apr 23, 2022 at 01:23:31AM -0400, Ian Cowan wrote:
> On Fri, Apr 22, 2022 at 07:10:34AM +0200, Greg KH wrote:
> > On Thu, Apr 21, 2022 at 08:30:25PM -0400, Ian Cowan wrote:
> > > On Thu, Apr 21, 2022 at 06:52:04PM +0300, Dan Carpenter wrote:
> > > > On Thu, Apr 21, 2022 at 11:22:00AM -0400, Ian Cowan wrote:
> > > > > 
> > > > > For using the dev_dbg() macro, do you define this in the header file
> > > > > (i.e. for this it would be videocodec.h), or where should this be
> > > > > included from?
> > > > 
> > > > dev_dbg() is defined in include/linux/dev_printk.h.  Look around at how
> > > > it's used.  pr_debug() might be an option, but I don't know if we will
> > > > accept that, we prefer dev_dbg().
> > > > 
> > > > regards,
> > > > dan carpenter
> > > > 
> > > 
> > > I'm about to submit the modified patch, but I went and looked and we
> > > cannot use dev_dbg() because these specific drivers do not have any
> > > association with a device struct.
> > 
> > Then please fix that issue, as there is a real struct device that they
> > are using somewhere.  That is the correct solution as drivers should
> > never use pr_* calls directly.
> > 
> > thanks,
> > 
> > greg k-h
> > 
> 
> I just resubmitted and this time used dev_dbg() (I split the resubmitted
> patch into 4 parts that will work if they are applied in order). There
> were a few places that pr_debug() had to be used (or it can be changed
> back to dprintk()) because they are cleanup functions and do not have
> any devices available at the cleanup. If there is a better way to handle
> that, I will go back and make a modification to that. Other than those 3
> spots, dev_dbg() is being used.

Looks good, nice work!


___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] [PATCH 1/4] staging: media: zoran: add zrdev_dbg() macros

2022-04-25 Thread Greg KH
On Sun, Apr 24, 2022 at 09:22:30PM -0400, Ian Cowan wrote:
> On Sun, Apr 24, 2022 at 09:17:22PM +0200, LABBE Corentin wrote:
> > Hello
> > 
> > Thanks for your patchs, removing dprintk is a good idea.
> > Please use pci_xxx() instead of dev_xxx() to be consistent with the rest of 
> > the driver.
> > The comment title is misleading, zrdev_err is not about debugging. What 
> > about Logging macros ?
> > 
> > Regards
> > 
> 
> I have made those modifications, and I will resubmit patches 1 and 2
> shortly. Those are the only patches that affected by this change; 3 and
> 4 will not change.

You should send a whole new series, properly versioned as the
documentation in the kernel asks you to.  Otherwise it is impossible for
reviewers and maintainers to know what is the "latest" version to
accept.

thanks,

greg k-h


___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users