public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Corentin Labbe <clabbe@baylibre.com>
To: gregkh@linuxfoundation.org, mchehab@kernel.org,
	hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	linux-media@vger.kernel.org, Corentin Labbe <clabbe@baylibre.com>
Subject: [PATCH RFT/RFC v2 12/47] staging: media: zoran: remove proc_fs
Date: Fri, 25 Sep 2020 18:30:22 +0000	[thread overview]
Message-ID: <1601058657-14042-13-git-send-email-clabbe@baylibre.com> (raw)
In-Reply-To: <1601058657-14042-1-git-send-email-clabbe@baylibre.com>

The zoran driver give some debug information in procfs, but this is not
the right place.
So let's remove them, we will use debugfs later.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
 drivers/staging/media/zoran/Makefile       |   2 +-
 drivers/staging/media/zoran/zoran.h        |   5 -
 drivers/staging/media/zoran/zoran_card.c   |   6 -
 drivers/staging/media/zoran/zoran_device.c |   1 -
 drivers/staging/media/zoran/zoran_driver.c |   1 -
 drivers/staging/media/zoran/zoran_procfs.c | 213 ---------------------
 drivers/staging/media/zoran/zoran_procfs.h |  32 ----
 7 files changed, 1 insertion(+), 259 deletions(-)
 delete mode 100644 drivers/staging/media/zoran/zoran_procfs.c
 delete mode 100644 drivers/staging/media/zoran/zoran_procfs.h

diff --git a/drivers/staging/media/zoran/Makefile b/drivers/staging/media/zoran/Makefile
index 21ac29a71458..7023158e3892 100644
--- a/drivers/staging/media/zoran/Makefile
+++ b/drivers/staging/media/zoran/Makefile
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-zr36067-objs	:=	zoran_procfs.o zoran_device.o \
+zr36067-objs	:=	zoran_device.o \
 			zoran_driver.o zoran_card.o
 
 obj-$(CONFIG_VIDEO_ZORAN) += zr36067.o videocodec.o
diff --git a/drivers/staging/media/zoran/zoran.h b/drivers/staging/media/zoran/zoran.h
index eac8e49a080f..1b3eceaead5a 100644
--- a/drivers/staging/media/zoran/zoran.h
+++ b/drivers/staging/media/zoran/zoran.h
@@ -346,11 +346,6 @@ struct zoran {
 	struct zoran_buffer_col jpg_buffers;	/* MJPEG buffers' info */
 
 	/* Additional stuff for testing */
-#ifdef CONFIG_PROC_FS
-	struct proc_dir_entry *zoran_proc;
-#else
-	void *zoran_proc;
-#endif
 	int testing;
 	int jpeg_error;
 	int intr_counter_GIRQ1;
diff --git a/drivers/staging/media/zoran/zoran_card.c b/drivers/staging/media/zoran/zoran_card.c
index e9c0dc1c0313..93a0817a3936 100644
--- a/drivers/staging/media/zoran/zoran_card.c
+++ b/drivers/staging/media/zoran/zoran_card.c
@@ -18,7 +18,6 @@
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
 
-#include <linux/proc_fs.h>
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 #include <linux/videodev2.h>
@@ -38,7 +37,6 @@
 #include "zoran.h"
 #include "zoran_card.h"
 #include "zoran_device.h"
-#include "zoran_procfs.h"
 
 extern const struct zoran_format zoran_formats[];
 
@@ -978,7 +976,6 @@ static int zr36057_init(struct zoran *zr)
 		encoder_call(zr, video, s_routing, 2, 0, 0);
 	}
 
-	zr->zoran_proc = NULL;
 	zr->initialized = 1;
 	return 0;
 
@@ -1019,7 +1016,6 @@ static void zoran_remove(struct pci_dev *pdev)
 	free_irq(zr->pci_dev->irq, zr);
 	/* unmap and free memory */
 	kfree(zr->stat_com);
-	zoran_proc_cleanup(zr);
 	iounmap(zr->zr36057_mem);
 	pci_disable_device(zr->pci_dev);
 	video_unregister_device(zr->video_dev);
@@ -1280,8 +1276,6 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (zr36057_init(zr) < 0)
 		goto zr_detach_vfe;
 
-	zoran_proc_init(zr);
-
 	return 0;
 
 zr_detach_vfe:
diff --git a/drivers/staging/media/zoran/zoran_device.c b/drivers/staging/media/zoran/zoran_device.c
index e50153218f72..04ba22a915f0 100644
--- a/drivers/staging/media/zoran/zoran_device.c
+++ b/drivers/staging/media/zoran/zoran_device.c
@@ -17,7 +17,6 @@
 #include <linux/sched/signal.h>
 
 #include <linux/interrupt.h>
-#include <linux/proc_fs.h>
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 #include <linux/videodev2.h>
diff --git a/drivers/staging/media/zoran/zoran_driver.c b/drivers/staging/media/zoran/zoran_driver.c
index 21a258b7be13..0d6c58a4161e 100644
--- a/drivers/staging/media/zoran/zoran_driver.c
+++ b/drivers/staging/media/zoran/zoran_driver.c
@@ -53,7 +53,6 @@
 #include <asm/byteorder.h>
 #include <linux/io.h>
 #include <linux/uaccess.h>
-#include <linux/proc_fs.h>
 
 #include <linux/mutex.h>
 #include "zoran.h"
diff --git a/drivers/staging/media/zoran/zoran_procfs.c b/drivers/staging/media/zoran/zoran_procfs.c
deleted file mode 100644
index 98f9e0103d83..000000000000
--- a/drivers/staging/media/zoran/zoran_procfs.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Zoran zr36057/zr36067 PCI controller driver, for the
- * Pinnacle/Miro DC10/DC10+/DC30/DC30+, Iomega Buz, Linux
- * Media Labs LML33/LML33R10.
- *
- * This part handles the procFS entries (/proc/ZORAN[%d])
- *
- * Copyright (C) 2000 Serguei Miridonov <mirsev@cicese.mx>
- *
- * Currently maintained by:
- *   Ronald Bultje    <rbultje@ronald.bitfreak.net>
- *   Laurent Pinchart <laurent.pinchart@skynet.be>
- *   Mailinglist      <mjpeg-users@lists.sf.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/printk.h>
-#include <linux/vmalloc.h>
-
-#include <linux/proc_fs.h>
-#include <linux/pci.h>
-#include <linux/i2c.h>
-#include <linux/i2c-algo-bit.h>
-#include <linux/videodev2.h>
-#include <linux/spinlock.h>
-#include <linux/sem.h>
-#include <linux/seq_file.h>
-
-#include <linux/ctype.h>
-#include <linux/poll.h>
-#include <asm/io.h>
-
-#include "videocodec.h"
-#include "zoran.h"
-#include "zoran_procfs.h"
-#include "zoran_card.h"
-
-#ifdef CONFIG_PROC_FS
-struct procfs_params_zr36067 {
-	char *name;
-	short reg;
-	u32 mask;
-	short bit;
-};
-
-static const struct procfs_params_zr36067 zr67[] = {
-	{"HSPol", 0x000, 1, 30},
-	{"HStart", 0x000, 0x3ff, 10},
-	{"HEnd", 0x000, 0x3ff, 0},
-
-	{"VSPol", 0x004, 1, 30},
-	{"VStart", 0x004, 0x3ff, 10},
-	{"VEnd", 0x004, 0x3ff, 0},
-
-	{"ExtFl", 0x008, 1, 26},
-	{"TopField", 0x008, 1, 25},
-	{"VCLKPol", 0x008, 1, 24},
-	{"DupFld", 0x008, 1, 20},
-	{"LittleEndian", 0x008, 1, 0},
-
-	{"HsyncStart", 0x10c, 0xffff, 16},
-	{"LineTot", 0x10c, 0xffff, 0},
-
-	{"NAX", 0x110, 0xffff, 16},
-	{"PAX", 0x110, 0xffff, 0},
-
-	{"NAY", 0x114, 0xffff, 16},
-	{"PAY", 0x114, 0xffff, 0},
-
-	/* {"",,,}, */
-
-	{NULL, 0, 0, 0},
-};
-
-static void setparam(struct zoran *zr, char *name, char *sval)
-{
-	int i = 0, reg0, reg, val;
-
-	while (zr67[i].name) {
-		if (!strncmp(name, zr67[i].name, strlen(zr67[i].name))) {
-			reg = reg0 = btread(zr67[i].reg);
-			reg &= ~(zr67[i].mask << zr67[i].bit);
-			if (!isdigit(sval[0]))
-				break;
-			val = simple_strtoul(sval, NULL, 0);
-			if ((val & ~zr67[i].mask))
-				break;
-			reg |= (val & zr67[i].mask) << zr67[i].bit;
-			dprintk(4,
-				KERN_INFO
-				"%s: setparam: setting ZR36067 register 0x%03x: 0x%08x=>0x%08x %s=%d\n",
-				ZR_DEVNAME(zr), zr67[i].reg, reg0, reg,
-				zr67[i].name, val);
-			btwrite(reg, zr67[i].reg);
-			break;
-		}
-		i++;
-	}
-}
-
-static int zoran_show(struct seq_file *p, void *v)
-{
-	struct zoran *zr = p->private;
-	int i;
-
-	seq_printf(p, "ZR36067 registers:\n");
-	for (i = 0; i < 0x130; i += 16)
-		seq_printf(p, "%03X %08X  %08X  %08X  %08X\n", i,
-			   btread(i), btread(i + 4), btread(i + 8), btread(i + 12));
-	return 0;
-}
-
-static int zoran_open(struct inode *inode, struct file *file)
-{
-	struct zoran *data = PDE_DATA(inode);
-
-	return single_open(file, zoran_show, data);
-}
-
-static ssize_t zoran_write(struct file *file, const char __user *buffer,
-			   size_t count, loff_t *ppos)
-{
-	struct zoran *zr = PDE_DATA(file_inode(file));
-	char *string, *sp;
-	char *line, *ldelim, *varname, *svar, *tdelim;
-
-	if (count > 32768)	/* Stupidity filter */
-		return -EINVAL;
-
-	string = sp = vmalloc(count + 1);
-	if (!string) {
-		return -ENOMEM;
-	}
-	if (copy_from_user(string, buffer, count)) {
-		vfree(string);
-		return -EFAULT;
-	}
-	string[count] = 0;
-	dprintk(4, KERN_INFO "%s: write_proc: name=%pD count=%zu zr=%p\n",
-		ZR_DEVNAME(zr), file, count, zr);
-	ldelim = " \t\n";
-	tdelim = "=";
-	line = strpbrk(sp, ldelim);
-	while (line) {
-		*line = 0;
-		svar = strpbrk(sp, tdelim);
-		if (svar) {
-			*svar = 0;
-			varname = sp;
-			svar++;
-			setparam(zr, varname, svar);
-		}
-		sp = line + 1;
-		line = strpbrk(sp, ldelim);
-	}
-	vfree(string);
-
-	return count;
-}
-
-static const struct file_operations zoran_operations = {
-	.owner		= THIS_MODULE,
-	.open		= zoran_open,
-	.read		= seq_read,
-	.write		= zoran_write,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-};
-#endif
-
-int zoran_proc_init(struct zoran *zr)
-{
-#ifdef CONFIG_PROC_FS
-	char name[8];
-
-	snprintf(name, 7, "zoran%d", zr->id);
-	zr->zoran_proc = proc_create_data(name, 0, NULL, &zoran_operations, zr);
-	if (zr->zoran_proc) {
-		dprintk(2,
-			KERN_INFO
-			"%s: procfs entry /proc/%s allocated. data=%p\n",
-			ZR_DEVNAME(zr), name, zr);
-	} else {
-		pr_err("%s: Unable to initialise /proc/%s\n", ZR_DEVNAME(zr), name);
-		return 1;
-	}
-#endif
-	return 0;
-}
-
-void zoran_proc_cleanup(struct zoran *zr)
-{
-#ifdef CONFIG_PROC_FS
-	char name[8];
-
-	snprintf(name, 7, "zoran%d", zr->id);
-	if (zr->zoran_proc)
-		remove_proc_entry(name, NULL);
-	zr->zoran_proc = NULL;
-#endif
-}
diff --git a/drivers/staging/media/zoran/zoran_procfs.h b/drivers/staging/media/zoran/zoran_procfs.h
deleted file mode 100644
index 0ac7cb0011f2..000000000000
--- a/drivers/staging/media/zoran/zoran_procfs.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Zoran zr36057/zr36067 PCI controller driver, for the
- * Pinnacle/Miro DC10/DC10+/DC30/DC30+, Iomega Buz, Linux
- * Media Labs LML33/LML33R10.
- *
- * This part handles card-specific data and detection
- *
- * Copyright (C) 2000 Serguei Miridonov <mirsev@cicese.mx>
- *
- * Currently maintained by:
- *   Ronald Bultje    <rbultje@ronald.bitfreak.net>
- *   Laurent Pinchart <laurent.pinchart@skynet.be>
- *   Mailinglist      <mjpeg-users@lists.sf.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ZORAN_PROCFS_H__
-#define __ZORAN_PROCFS_H__
-
-extern int zoran_proc_init(struct zoran *zr);
-extern void zoran_proc_cleanup(struct zoran *zr);
-
-#endif				/* __ZORAN_PROCFS_H__ */
-- 
2.26.2


  parent reply	other threads:[~2020-09-25 18:32 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 18:30 [PATCH RFT/RFC v2 00/47] staging: media: bring back zoran driver Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 01/47] staging: media: Revert "media: zoran: remove deprecated driver" Corentin Labbe
     [not found]   ` <CA+QCeVRjnU6RwHkj3c54pzLq6yeaZ1Lz8eG4vDOkGT5RyKvJhA@mail.gmail.com>
2022-05-07 16:11     ` Laurent Pinchart
2020-09-25 18:30 ` [PATCH RFT/RFC v2 02/47] MAINTAINERS: change maintainer of the zoran driver Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 03/47] staging: media: zoran: datasheet is no longer available from zoran.com Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 04/47] staging: media: zoran: Documentation: fix typo Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 05/47] staging: media: zoran: fix checkpatch issue Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 06/47] staging: media: zoran: do not forward declare zr36057_init_vfe Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 07/47] staging: media: zoran: convert all error dprintk to pci_err/pr_err Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 08/47] staging: media: zoran: convert dprintk warn Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 09/47] staging: media: zoran: convert dprintk info to pci_info Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 10/47] staging: media: zoran: convert dprintk debug Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 11/47] staging: media: zoran: zoran_device.c: convert pr_x to pci_x Corentin Labbe
2020-09-25 18:36   ` Joe Perches
2020-09-25 18:30 ` Corentin Labbe [this message]
2020-09-25 18:30 ` [PATCH RFT/RFC v2 13/47] staging: media: zoran: use VFL_TYPE_VIDEO Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 14/47] staging: media: zoran: use v4l2_buffer_set_timestamp Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 15/47] staging: media: zoran: do not print random guest 0 Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 16/47] staging: media: zoran: move buffer_size out of zoran_fh Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 17/47] staging: media: zoran: move v4l_settings " Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 18/47] staging: media: zoran: move jpg_settings " Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 19/47] staging: media: zoran: move overlay_settings " Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 20/47] staging: media: zoran: Use video_drvdata to get struct zoran Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 21/47] staging: media: zoran: Change zoran_v4l_set_format parameter from zoran_fh to zoran Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 22/47] staging: media: zoran: remove overlay Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 23/47] staging: media: zoran: Use DMA coherent for stat_com Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 24/47] staging: media: zoran: use ZR_NORM Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 25/47] staging: media: zoran: zoran does not support STD_ALL Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 26/47] staging: media: zoran: convert irq to pci irq Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 27/47] staging: media: zoran: convert zoran alloc to devm Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 28/47] staging: media: zoran: convert mdelay to udelay Corentin Labbe
2020-10-01  7:54   ` Mauro Carvalho Chehab
2020-09-25 18:30 ` [PATCH RFT/RFC v2 29/47] staging: media: zoran: use devm for videocodec_master alloc Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 30/47] staging: media: zoran: use pci_request_regions Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 31/47] staging: media: zoran: use devm_ioremap Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 32/47] staging: media: zoran: add stat_com buffer Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 33/47] staging: media: zoran: constify struct tvnorm Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 34/47] staging: media: zoran: constify codec_name Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 35/47] staging: media: zoran: Add more check for compliance Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 36/47] staging: media: zoran: Add vb_queue Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 37/47] staging: media: zoran: disable output Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 38/47] staging: media: zoran: device support only 32bit DMA address Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 39/47] staging: media: zoran: enable makefile Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 40/47] staging: media: zoran: remove framebuffer support Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 41/47] staging: media: zoran: add vidioc_g_parm Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 42/47] staging: media: zoran: remove test_interrupts Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 43/47] staging: media: zoran: fix use of buffer_size and sizeimage Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 44/47] staging: media: zoran: fix some compliance test Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 45/47] staging: media: zoran: remove deprecated .vidioc_g_jpegcomp Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 46/47] staging: media: zoran: convert to vb2 Corentin Labbe
2020-09-25 18:30 ` [PATCH RFT/RFC v2 47/47] staging: media: zoran: update TODO Corentin Labbe
2020-09-28 13:45 ` [PATCH RFT/RFC v2 00/47] staging: media: bring back zoran driver Hans Verkuil
2020-09-28 13:53   ` Laurent Pinchart
2020-09-28 14:01     ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1601058657-14042-13-git-send-email-clabbe@baylibre.com \
    --to=clabbe@baylibre.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox