All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <florian@openwrt.org>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: davem@davemloft.net,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Russell King <linux@arm.linux.org.uk>,
	Jason Cooper <jason@lakedaemon.net>,
	linux-doc@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org,
	Rob Herring <rob.herring@calxeda.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	netdev@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
	linux-arm-kernel@lists.infradead.org,
	Rob Landley <rob@landley.net>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linuxppc-dev@lists.ozlabs.org,
	Lennert Buytenhek <buytenh@wantstofly.org>
Subject: Re: [PATCH 4/5] net: mvmdio: allow Device Tree and platform device to coexist
Date: Tue, 29 Jan 2013 21:41:45 +0100	[thread overview]
Message-ID: <201301292141.45931.florian@openwrt.org> (raw)
In-Reply-To: <20130129175912.GE25646@obsidianresearch.com>

Le mardi 29 janvier 2013 18:59:12, Jason Gunthorpe a écrit :
> On Tue, Jan 29, 2013 at 04:24:07PM +0100, Florian Fainelli wrote:
> > -	dev->err_interrupt = irq_of_parse_and_map(pdev->dev.of_node, 0);
> > +	if (pdev->dev.of_node) {
> > +		dev->regs = of_iomap(pdev->dev.of_node, 0);
> > +		if (!dev->regs) {
> > +			dev_err(&pdev->dev, "No SMI register address given in 
DT\n");
> > +			ret = -ENODEV;
> > +			goto out_free;
> > +		}
> > +
> > +		dev->err_interrupt = irq_of_parse_and_map(pdev->dev.of_node, 0);
> > +	} else {
> > +		r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +
> > +		dev->regs = ioremap(r->start, resource_size(r));
> > +		if (!dev->regs) {
> > +			dev_err(&pdev->dev, "No SMI register address given\n");
> > +			ret = -ENODEV;
> > +			goto out_free;
> > +		}
> > +
> > +		dev->err_interrupt = platform_get_irq(pdev, 0);
> > +	}
> 
> Why do you have these different paths for OF and platform? AFAIK these
> days when a OF device is automatically converted into a platform
> device all the struct resources are created too, so you can't you just
> use platform_get_resource and devm_request_and_ioremap for both flows?
> 
> Ditto for the interrupt - platform_get_irq should work in both cases?

There was no particular reason and I updated the patchset to do that precisely 
in version 2.
-- 
Florian

WARNING: multiple messages have this Message-ID (diff)
From: Florian Fainelli <florian@openwrt.org>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Russell King <linux@arm.linux.org.uk>,
	Jason Cooper <jason@lakedaemon.net>,
	linux-doc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org,
	Rob Herring <rob.herring@calxeda.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Paul Mackerras <paulus@samba.org>,
	Lennert Buytenhek <buytenh@wantstofly.org>,
	Rob Landley <rob@landley.net>,
	netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	davem@davemloft.net, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 4/5] net: mvmdio: allow Device Tree and platform device to coexist
Date: Tue, 29 Jan 2013 21:41:45 +0100	[thread overview]
Message-ID: <201301292141.45931.florian@openwrt.org> (raw)
In-Reply-To: <20130129175912.GE25646@obsidianresearch.com>

Le mardi 29 janvier 2013 18:59:12, Jason Gunthorpe a =E9crit :
> On Tue, Jan 29, 2013 at 04:24:07PM +0100, Florian Fainelli wrote:
> > -	dev->err_interrupt =3D irq_of_parse_and_map(pdev->dev.of_node, 0);
> > +	if (pdev->dev.of_node) {
> > +		dev->regs =3D of_iomap(pdev->dev.of_node, 0);
> > +		if (!dev->regs) {
> > +			dev_err(&pdev->dev, "No SMI register address given in=20
DT\n");
> > +			ret =3D -ENODEV;
> > +			goto out_free;
> > +		}
> > +
> > +		dev->err_interrupt =3D irq_of_parse_and_map(pdev->dev.of_node, 0);
> > +	} else {
> > +		r =3D platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +
> > +		dev->regs =3D ioremap(r->start, resource_size(r));
> > +		if (!dev->regs) {
> > +			dev_err(&pdev->dev, "No SMI register address given\n");
> > +			ret =3D -ENODEV;
> > +			goto out_free;
> > +		}
> > +
> > +		dev->err_interrupt =3D platform_get_irq(pdev, 0);
> > +	}
>=20
> Why do you have these different paths for OF and platform? AFAIK these
> days when a OF device is automatically converted into a platform
> device all the struct resources are created too, so you can't you just
> use platform_get_resource and devm_request_and_ioremap for both flows?
>=20
> Ditto for the interrupt - platform_get_irq should work in both cases?

There was no particular reason and I updated the patchset to do that precis=
ely=20
in version 2.
=2D-=20
=46lorian

WARNING: multiple messages have this Message-ID (diff)
From: florian@openwrt.org (Florian Fainelli)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] net: mvmdio: allow Device Tree and platform device to coexist
Date: Tue, 29 Jan 2013 21:41:45 +0100	[thread overview]
Message-ID: <201301292141.45931.florian@openwrt.org> (raw)
In-Reply-To: <20130129175912.GE25646@obsidianresearch.com>

Le mardi 29 janvier 2013 18:59:12, Jason Gunthorpe a ?crit :
> On Tue, Jan 29, 2013 at 04:24:07PM +0100, Florian Fainelli wrote:
> > -	dev->err_interrupt = irq_of_parse_and_map(pdev->dev.of_node, 0);
> > +	if (pdev->dev.of_node) {
> > +		dev->regs = of_iomap(pdev->dev.of_node, 0);
> > +		if (!dev->regs) {
> > +			dev_err(&pdev->dev, "No SMI register address given in 
DT\n");
> > +			ret = -ENODEV;
> > +			goto out_free;
> > +		}
> > +
> > +		dev->err_interrupt = irq_of_parse_and_map(pdev->dev.of_node, 0);
> > +	} else {
> > +		r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +
> > +		dev->regs = ioremap(r->start, resource_size(r));
> > +		if (!dev->regs) {
> > +			dev_err(&pdev->dev, "No SMI register address given\n");
> > +			ret = -ENODEV;
> > +			goto out_free;
> > +		}
> > +
> > +		dev->err_interrupt = platform_get_irq(pdev, 0);
> > +	}
> 
> Why do you have these different paths for OF and platform? AFAIK these
> days when a OF device is automatically converted into a platform
> device all the struct resources are created too, so you can't you just
> use platform_get_resource and devm_request_and_ioremap for both flows?
> 
> Ditto for the interrupt - platform_get_irq should work in both cases?

There was no particular reason and I updated the patchset to do that precisely 
in version 2.
-- 
Florian

  reply	other threads:[~2013-01-29 20:41 UTC|newest]

Thread overview: 162+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29 15:24 [PATCH 0/5] mv643xx_eth: use mvmdio MDIO bus driver Florian Fainelli
2013-01-29 15:24 ` Florian Fainelli
2013-01-29 15:24 ` Florian Fainelli
2013-01-29 15:24 ` Florian Fainelli
2013-01-29 15:24 ` [PATCH 1/5] net: mvmdio: unmap base register address at driver removal Florian Fainelli
2013-01-29 15:24   ` Florian Fainelli
2013-01-29 15:24   ` Florian Fainelli
2013-01-29 15:32   ` Thomas Petazzoni
2013-01-29 15:32     ` Thomas Petazzoni
2013-01-29 15:32     ` Thomas Petazzoni
2013-01-29 15:35     ` Florian Fainelli
2013-01-29 15:35       ` Florian Fainelli
2013-01-29 15:35       ` Florian Fainelli
2013-01-29 15:24 ` [PATCH 2/5] net: mvmdio: rename base register cookie from smireg to regs Florian Fainelli
2013-01-29 15:24   ` Florian Fainelli
2013-01-29 15:24   ` Florian Fainelli
2013-01-29 15:24   ` Florian Fainelli
2013-01-29 15:34   ` Thomas Petazzoni
2013-01-29 15:34     ` Thomas Petazzoni
2013-01-29 15:34     ` Thomas Petazzoni
2013-01-29 15:24 ` [PATCH 3/5] net: mvmdio: enhance driver to support SMI error/done interrupts Florian Fainelli
2013-01-29 15:24   ` Florian Fainelli
2013-01-29 15:24   ` Florian Fainelli
2013-01-29 15:39   ` Thomas Petazzoni
2013-01-29 15:39     ` Thomas Petazzoni
2013-01-29 15:39     ` Thomas Petazzoni
2013-01-29 15:24 ` [PATCH 4/5] net: mvmdio: allow Device Tree and platform device to coexist Florian Fainelli
2013-01-29 15:24   ` Florian Fainelli
2013-01-29 15:24   ` Florian Fainelli
2013-01-29 15:48   ` Thomas Petazzoni
2013-01-29 15:48     ` Thomas Petazzoni
2013-01-29 15:48     ` Thomas Petazzoni
2013-01-29 17:59   ` Jason Gunthorpe
2013-01-29 17:59     ` Jason Gunthorpe
2013-01-29 17:59     ` Jason Gunthorpe
2013-01-29 20:41     ` Florian Fainelli [this message]
2013-01-29 20:41       ` Florian Fainelli
2013-01-29 20:41       ` Florian Fainelli
2013-01-29 15:24 ` [PATCH 5/5] mv643xx_eth: convert to use the Marvell Orion MDIO driver Florian Fainelli
2013-01-29 15:24   ` Florian Fainelli
2013-01-29 15:24   ` Florian Fainelli
2013-01-29 16:01   ` Thomas Petazzoni
2013-01-29 16:01     ` Thomas Petazzoni
2013-01-29 16:01     ` Thomas Petazzoni
2013-01-29 16:27     ` Florian Fainelli
2013-01-29 16:27       ` Florian Fainelli
2013-01-29 16:27       ` Florian Fainelli
2013-01-29 16:46       ` Thomas Petazzoni
2013-01-29 16:46         ` Thomas Petazzoni
2013-01-29 16:46         ` Thomas Petazzoni
2013-01-29 18:13   ` Jason Gunthorpe
2013-01-29 18:13     ` Jason Gunthorpe
2013-01-29 18:13     ` Jason Gunthorpe
2013-01-29 20:41     ` Florian Fainelli
2013-01-29 20:41       ` Florian Fainelli
2013-01-29 20:41       ` Florian Fainelli
2013-03-14 17:25 ` [PATCH 0/5] mv643xx_eth: use mvmdio MDIO bus driver Jason Cooper
2013-03-14 17:25   ` Jason Cooper
2013-03-14 17:25   ` Jason Cooper
2013-03-14 17:25   ` Jason Cooper
2013-03-14 18:09   ` Florian Fainelli
2013-03-14 18:09     ` Florian Fainelli
2013-03-14 18:09     ` Florian Fainelli
2013-03-14 18:16     ` Jason Cooper
2013-03-14 18:16       ` Jason Cooper
2013-03-14 18:16       ` Jason Cooper
2013-03-14 18:16       ` Jason Cooper
2013-03-14 18:08 ` [PATCH 0/4] " Florian Fainelli
2013-03-14 18:08   ` Florian Fainelli
2013-03-14 18:08   ` Florian Fainelli
2013-03-14 18:08   ` Florian Fainelli
2013-03-14 18:08   ` [PATCH] mv643xx_eth: convert to use the Marvell Orion MDIO driver Florian Fainelli
2013-03-14 18:08     ` Florian Fainelli
2013-03-14 18:08     ` Florian Fainelli
2013-03-14 19:02     ` Jason Cooper
2013-03-14 19:02       ` Jason Cooper
2013-03-14 19:02       ` Jason Cooper
2013-03-14 19:02       ` Jason Cooper
2013-03-14 19:32       ` Florian Fainelli
2013-03-14 19:32         ` Florian Fainelli
2013-03-14 19:32         ` Florian Fainelli
2013-03-14 20:36         ` Jason Cooper
2013-03-14 20:36           ` Jason Cooper
2013-03-14 20:36           ` Jason Cooper
2013-03-14 18:08   ` [PATCH 2/4 v2] net: mvmdio: rename base register cookie from smireg to regs Florian Fainelli
2013-03-14 18:08     ` Florian Fainelli
2013-03-14 18:08     ` Florian Fainelli
2013-03-14 18:08     ` Florian Fainelli
2013-03-14 18:08   ` [PATCH 3/4 v2] net: mvmdio: enhance driver to support SMI error/done interrupts Florian Fainelli
2013-03-14 18:08     ` Florian Fainelli
2013-03-14 18:08     ` Florian Fainelli
2013-03-14 18:08     ` Florian Fainelli
2013-03-15 18:05     ` Russell King - ARM Linux
2013-03-15 18:05       ` Russell King - ARM Linux
2013-03-15 18:05       ` Russell King - ARM Linux
2013-03-14 18:08   ` [PATCH 4/4 v2] mv643xx_eth: convert to use the Marvell Orion MDIO driver Florian Fainelli
2013-03-14 18:08     ` Florian Fainelli
2013-03-14 18:08     ` Florian Fainelli
2013-03-15 11:07     ` Florian Fainelli
2013-03-15 11:07       ` Florian Fainelli
2013-03-15 11:07       ` Florian Fainelli
2013-03-15 11:42       ` Thomas Petazzoni
2013-03-15 11:42         ` Thomas Petazzoni
2013-03-15 11:42         ` Thomas Petazzoni
2013-03-14 18:11   ` [PATCH 1/4 v2] net: mvmdio: allow platform device style registration Florian Fainelli
2013-03-14 18:11     ` Florian Fainelli
2013-03-14 18:11     ` Florian Fainelli
2013-03-15 12:53   ` [PATCH 0/4] mv643xx_eth: use mvmdio MDIO bus driver David Miller
2013-03-15 12:53     ` David Miller
2013-03-15 12:53     ` David Miller
2013-03-15 12:51     ` Florian Fainelli
2013-03-15 12:51       ` Florian Fainelli
2013-03-15 12:51       ` Florian Fainelli
2013-03-15 12:55     ` David Miller
2013-03-15 12:55       ` David Miller
2013-03-15 12:55       ` David Miller
2013-03-15 12:55       ` David Miller
2013-03-15 12:53       ` Florian Fainelli
2013-03-15 12:53         ` Florian Fainelli
2013-03-15 12:53         ` Florian Fainelli
2013-03-15 13:05         ` David Miller
2013-03-15 13:05           ` David Miller
2013-03-15 13:05           ` David Miller
2013-03-15 13:05           ` David Miller
2013-03-15 13:03           ` Florian Fainelli
2013-03-15 13:03             ` Florian Fainelli
2013-03-15 13:03             ` Florian Fainelli
2013-03-15 13:03             ` Florian Fainelli
2013-03-22 13:39   ` [PATCH 0/4 v3] " Florian Fainelli
2013-03-22 13:39     ` Florian Fainelli
2013-03-22 13:39     ` Florian Fainelli
2013-03-22 13:39     ` Florian Fainelli
2013-03-22 13:39     ` [PATCH 1/4 v3] net: mvmdio: allow platform device style registration Florian Fainelli
2013-03-22 13:39       ` Florian Fainelli
2013-03-22 13:39       ` Florian Fainelli
2013-03-22 13:39     ` [PATCH 2/4 v3] net: mvmdio: rename base register cookie from smireg to regs Florian Fainelli
2013-03-22 13:39       ` Florian Fainelli
2013-03-22 13:39       ` Florian Fainelli
2013-03-22 13:39     ` [PATCH 3/4 v3] net: mvmdio: enhance driver to support SMI error/done interrupts Florian Fainelli
2013-03-22 13:39       ` Florian Fainelli
2013-03-22 13:39       ` Florian Fainelli
2013-03-22 13:39     ` [PATCH 4/4 v3] mv643xx_eth: convert to use the Marvell Orion MDIO driver Florian Fainelli
2013-03-22 13:39       ` Florian Fainelli
2013-03-22 13:39       ` Florian Fainelli
2013-03-22 13:53     ` [PATCH 0/4 v3] mv643xx_eth: use mvmdio MDIO bus driver Thomas Petazzoni
2013-03-22 13:53       ` Thomas Petazzoni
2013-03-22 13:53       ` Thomas Petazzoni
2013-03-22 14:14     ` Jason Cooper
2013-03-22 14:14       ` Jason Cooper
2013-03-22 14:14       ` Jason Cooper
2013-03-22 14:24       ` Florian Fainelli
2013-03-22 14:24         ` Florian Fainelli
2013-03-22 14:24         ` Florian Fainelli
2013-03-22 14:29         ` Jason Cooper
2013-03-22 14:29           ` Jason Cooper
2013-03-22 14:29           ` Jason Cooper
2013-03-22 14:31           ` Florian Fainelli
2013-03-22 14:31             ` Florian Fainelli
2013-03-22 14:31             ` Florian Fainelli
2013-03-22 14:26     ` David Miller
2013-03-22 14:26       ` David Miller
2013-03-22 14:26       ` David Miller

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=201301292141.45931.florian@openwrt.org \
    --to=florian@openwrt.org \
    --cc=andrew@lunn.ch \
    --cc=benh@kernel.crashing.org \
    --cc=buytenh@wantstofly.org \
    --cc=davem@davemloft.net \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@linuxfoundation.org \
    --cc=jason@lakedaemon.net \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=thomas.petazzoni@free-electrons.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.