linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: dgap: remove unused configuration
@ 2015-10-04 15:49 Sudip Mukherjee
  2015-10-05  9:46 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Sudip Mukherjee @ 2015-10-04 15:49 UTC (permalink / raw)
  To: Lidza Louina, Daeseok Youn, Greg Kroah-Hartman
  Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee

The IO configuration was not used to configure the board. It was only
read from the configuration file. Stop reading it and also remove the
other related variables defined for it.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---

 drivers/staging/dgap/dgap.c | 21 ---------------------
 drivers/staging/dgap/dgap.h |  4 ----
 2 files changed, 25 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 64f6149..aa3aa72 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -248,7 +248,6 @@ static struct toklist dgap_tlist[] = {
 	{ BEGIN,	"config_begin" },
 	{ END,		"config_end" },
 	{ BOARD,	"board"	},
-	{ IO,		"io" },
 	{ PCIINFO,	"pciinfo" },
 	{ LINE,		"line" },
 	{ CONC,		"conc" },
@@ -662,25 +661,6 @@ static int dgap_parsefile(char **in)
 
 			break;
 
-		case IO:	/* i/o port */
-			if (p->type != BNODE) {
-				pr_err("IO port only valid for boards");
-				return -1;
-			}
-			s = dgap_getword(in);
-			if (!s) {
-				pr_err("unexpected end of file");
-				return -1;
-			}
-			kfree(p->u.board.portstr);
-			p->u.board.portstr = kstrdup(s, GFP_KERNEL);
-			if (kstrtol(s, 0, &p->u.board.port)) {
-				pr_err("bad number for IO port");
-				return -1;
-			}
-			p->u.board.v_port = 1;
-			break;
-
 		case MEM:	/* memory address */
 			if (p->type != BNODE) {
 				pr_err("memory address only valid for boards");
@@ -1296,7 +1276,6 @@ static void dgap_cleanup_nodes(void)
 
 		switch (p->type) {
 		case BNODE:
-			kfree(p->u.board.portstr);
 			kfree(p->u.board.addrstr);
 			kfree(p->u.board.pcibusstr);
 			kfree(p->u.board.pcislotstr);
diff --git a/drivers/staging/dgap/dgap.h b/drivers/staging/dgap/dgap.h
index e707ed5..c84dbf2 100644
--- a/drivers/staging/dgap/dgap.h
+++ b/drivers/staging/dgap/dgap.h
@@ -409,7 +409,6 @@
 #define	ID	76
 #define CABLE	77
 #define CONNECT	78
-#define	IO	79
 #define	MEM	80
 #define DPSZ	81
 
@@ -1152,8 +1151,6 @@ struct cnode {
 	union {
 		struct {
 			char  type;	/* Board Type           */
-			long  port;	/* I/O Address		*/
-			char  *portstr; /* I/O Address in string */
 			long  addr;	/* Memory Address	*/
 			char  *addrstr; /* Memory Address in string */
 			long  pcibus;	/* PCI BUS		*/
@@ -1164,7 +1161,6 @@ struct cnode {
 			char  *id;	/* tty id		*/
 			long  start;	/* start of tty counting */
 			char  *method;  /* Install method       */
-			char  v_port;
 			char  v_addr;
 			char  v_pcibus;
 			char  v_pcislot;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: dgap: remove unused configuration
  2015-10-04 15:49 [PATCH] staging: dgap: remove unused configuration Sudip Mukherjee
@ 2015-10-05  9:46 ` Dan Carpenter
  2015-10-05 10:13   ` Sudip Mukherjee
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2015-10-05  9:46 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Lidza Louina, Daeseok Youn, Greg Kroah-Hartman, devel,
	driverdev-devel, linux-kernel

On Sun, Oct 04, 2015 at 09:19:20PM +0530, Sudip Mukherjee wrote:
> The IO configuration was not used to configure the board. It was only
> read from the configuration file. Stop reading it and also remove the
> other related variables defined for it.
> 
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>

But say someone has an old config file with IO in it, doesn't this break
their system?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: dgap: remove unused configuration
  2015-10-05  9:46 ` Dan Carpenter
@ 2015-10-05 10:13   ` Sudip Mukherjee
  0 siblings, 0 replies; 3+ messages in thread
From: Sudip Mukherjee @ 2015-10-05 10:13 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: devel, Lidza Louina, Daeseok Youn, driverdev-devel, linux-kernel,
	Greg Kroah-Hartman

On Mon, Oct 05, 2015 at 12:46:43PM +0300, Dan Carpenter wrote:
> On Sun, Oct 04, 2015 at 09:19:20PM +0530, Sudip Mukherjee wrote:
> > The IO configuration was not used to configure the board. It was only
> > read from the configuration file. Stop reading it and also remove the
> > other related variables defined for it.
> > 
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> 
> But say someone has an old config file with IO in it, doesn't this break
> their system?
No, it should not. dgap_parsefile() is executing a loop and reading
tokens from the configuration file and depending on what token it has
read it will do switch-case. And it will not find case IO: anymore and
will be just ignored (there is no default:).

And this is actually just a first step towards removing the
configuration file as Greg was telling that loading a firmware file and
consideing it as a configuartion file is not the right thing to do. So I
am removing all the unused configurations one at a time and after they
are removed then depending on the configurations left I will ask for
your suggestion how to remove the use of configuration file.

regards
sudip

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-05 10:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-04 15:49 [PATCH] staging: dgap: remove unused configuration Sudip Mukherjee
2015-10-05  9:46 ` Dan Carpenter
2015-10-05 10:13   ` Sudip Mukherjee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).