Message ID | 1385451313-1875-4-git-send-email-sourav.poddar@ti.com |
---|---|
State | Not Applicable |
Headers | show |
On Tue, Nov 26, 2013 at 01:04:59PM +0530, Sourav Poddar wrote:
> Modify the qspi driver to parse reg information by name.
This presumably needs an update to the device tree bindings so that
there's a name defined?
On Tuesday 26 November 2013 04:00 PM, Mark Brown wrote: > On Tue, Nov 26, 2013 at 01:04:59PM +0530, Sourav Poddar wrote: >> Modify the qspi driver to parse reg information by name. > This presumably needs an update to the device tree bindings so that > there's a name defined? I have added "reg-names" property in dt bindings. (17/17) patch of this series has that info.
On Tue, Nov 26, 2013 at 04:47:49PM +0530, Sourav Poddar wrote: > I have added "reg-names" property in dt bindings. (17/17) patch of > this series has that info. Do device tree binding changes early on in the series rather than at the end, one of the things that gets reviewed for is binding updates. Your code should also cope with the existing bindings, falling back on the current behaviour if it can't get the names or the extra resources.
On Tuesday 26 November 2013 05:54 PM, Mark Brown wrote: > On Tue, Nov 26, 2013 at 04:47:49PM +0530, Sourav Poddar wrote: > >> I have added "reg-names" property in dt bindings. (17/17) patch of >> this series has that info. > Do device tree binding changes early on in the series rather than at the > end, one of the things that gets reviewed for is binding updates. > > Your code should also cope with the existing bindings, falling back on > the current behaviour if it can't get the names or the extra resources. My current code only has a single resouce, hence "*_byname* variants was not used. With extra resources, I am switching to "byname" variants, So, if a particular resource name is not found, it should just bypass that, thinking the resource is not required and should not resort to existing bindings..
On Thu, Nov 28, 2013 at 10:15:14AM +0530, Sourav Poddar wrote: > On Tuesday 26 November 2013 05:54 PM, Mark Brown wrote: > >Do device tree binding changes early on in the series rather than at the > >end, one of the things that gets reviewed for is binding updates. > >Your code should also cope with the existing bindings, falling back on > >the current behaviour if it can't get the names or the extra resources. > My current code only has a single resouce, hence "*_byname* variants > was not used. With extra resources, I am switching to "byname" variants, > So, if a particular resource name is not found, it should just > bypass that, thinking > the resource is not required and should not resort to existing bindings.. That means that if you switch all resources to _byname then the driver won't find any resources at all and will fail. This will in turn mean that any device trees that work with the current code wil start failing, breaking compatibility.
On Thursday 28 November 2013 04:24 PM, Mark Brown wrote: > On Thu, Nov 28, 2013 at 10:15:14AM +0530, Sourav Poddar wrote: >> On Tuesday 26 November 2013 05:54 PM, Mark Brown wrote: >>> Do device tree binding changes early on in the series rather than at the >>> end, one of the things that gets reviewed for is binding updates. >>> Your code should also cope with the existing bindings, falling back on >>> the current behaviour if it can't get the names or the extra resources. >> My current code only has a single resouce, hence "*_byname* variants >> was not used. With extra resources, I am switching to "byname" variants, >> So, if a particular resource name is not found, it should just >> bypass that, thinking >> the resource is not required and should not resort to existing bindings.. > That means that if you switch all resources to _byname then the driver > won't find any resources at all and will fail. This will in turn mean > that any device trees that work with the current code wil start failing, > breaking compatibility. I am changing my code to use *byname for all resources. There is no dts available now in mainline using this code. I have added the dts file as patch 15, 16 of this series to take care of this.
On Thu, Nov 28, 2013 at 04:28:07PM +0530, Sourav Poddar wrote: > On Thursday 28 November 2013 04:24 PM, Mark Brown wrote: > >That means that if you switch all resources to _byname then the driver > >won't find any resources at all and will fail. This will in turn mean > >that any device trees that work with the current code wil start failing, > >breaking compatibility. > I am changing my code to use *byname for all resources. There is no > dts available now in mainline using this code. I have added the dts file > as patch 15, 16 of this series to take care of this. We're now aiming for DT to be a stable interface and the existing binding has been included in a release so you really ought to be keeping compatiblity.
On Thursday 28 November 2013 04:41 PM, Mark Brown wrote: > On Thu, Nov 28, 2013 at 04:28:07PM +0530, Sourav Poddar wrote: >> On Thursday 28 November 2013 04:24 PM, Mark Brown wrote: >>> That means that if you switch all resources to _byname then the driver >>> won't find any resources at all and will fail. This will in turn mean >>> that any device trees that work with the current code wil start failing, >>> breaking compatibility. >> I am changing my code to use *byname for all resources. There is no >> dts available now in mainline using this code. I have added the dts file >> as patch 15, 16 of this series to take care of this. > We're now aiming for DT to be a stable interface and the existing > binding has been included in a release so you really ought to be keeping > compatiblity. Ok. So I will check for *byname, if not found I will switch to "platform_get_resource".
diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c index 033ef8d..67aa905 100644 --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c @@ -465,7 +465,11 @@ static int ti_qspi_probe(struct platform_device *pdev) qspi->master = master; qspi->dev = &pdev->dev; - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); + r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi_base"); + if (r == NULL) { + dev_err(&pdev->dev, "missing platform resources data\n"); + return -ENODEV; + } irq = platform_get_irq(pdev, 0); if (irq < 0) {
Modify the qspi driver to parse reg information by name. Signed-off-by: Sourav Poddar <sourav.poddar@ti.com> --- drivers/spi/spi-ti-qspi.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)