Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 498ac189 authored by Dominik Brodowski's avatar Dominik Brodowski
Browse files

pcmcia: pcmcia_config_loop() ConfigIndex unification



Almost all drivers set p_dev->conf.ConfigIndex to cfg->index in
the pcmcia_config_loop() callback function. Therefore, factor it out.

Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 84e2d340
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -181,7 +181,6 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,

	if ((cfg->io.nwin > 0) || (stk->dflt.io.nwin > 0)) {
		cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &stk->dflt.io;
		pdev->conf.ConfigIndex = cfg->index;
		pdev->io.BasePort1 = io->win[0].base;
		pdev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
		if (!(io->flags & CISTPL_IO_16BIT))
+0 −2
Original line number Diff line number Diff line
@@ -688,7 +688,6 @@ static int bt3c_check_config(struct pcmcia_device *p_dev,
		p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
	if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
	    (cf->io.win[0].base != 0)) {
		p_dev->conf.ConfigIndex = cf->index;
		p_dev->io.BasePort1 = cf->io.win[0].base;
		p_dev->io.IOAddrLines = (try == 0) ? 16 :
			cf->io.flags & CISTPL_IO_LINES_MASK;
@@ -706,7 +705,6 @@ static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev,
	int j;

	if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
		p_dev->conf.ConfigIndex = cf->index;
		for (j = 0; j < 5; j++) {
			p_dev->io.BasePort1 = base[j];
			p_dev->io.IOAddrLines = base[j] ? 16 : 3;
+0 −2
Original line number Diff line number Diff line
@@ -617,7 +617,6 @@ static int btuart_check_config(struct pcmcia_device *p_dev,
		p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
	if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
	    (cf->io.win[0].base != 0)) {
		p_dev->conf.ConfigIndex = cf->index;
		p_dev->io.BasePort1 = cf->io.win[0].base;
		p_dev->io.IOAddrLines = (try == 0) ? 16 :
			cf->io.flags & CISTPL_IO_LINES_MASK;
@@ -635,7 +634,6 @@ static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
	int j;

	if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
		p_dev->conf.ConfigIndex = cf->index;
		for (j = 0; j < 5; j++) {
			p_dev->io.BasePort1 = base[j];
			p_dev->io.IOAddrLines = base[j] ? 16 : 3;
+0 −1
Original line number Diff line number Diff line
@@ -595,7 +595,6 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev,
			  void *priv_data)
{
	if ((cf->io.nwin == 1) && (cf->io.win[0].len > 8)) {
		p_dev->conf.ConfigIndex = cf->index;
		p_dev->io.BasePort1 = cf->io.win[0].base;
		p_dev->io.NumPorts1 = cf->io.win[0].len;	/*yo */
		p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
+0 −2
Original line number Diff line number Diff line
@@ -1763,8 +1763,6 @@ static int cm4000_config_check(struct pcmcia_device *p_dev,
			       cistpl_cftable_entry_t *cfg,
			       void *priv_data)
{
	p_dev->conf.ConfigIndex = cfg->index;

	if (!cfg->io.nwin)
		return -ENODEV;

Loading