* [PATCH] spi: mpc512x-psc: Remove redundant code to get bus_num from DT
@ 2014-02-16 2:43 Axel Lin
2014-02-16 14:04 ` Gerhard Sittig
2014-02-18 2:04 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2014-02-16 2:43 UTC (permalink / raw)
To: Mark Brown
Cc: Anatolij Gustschin, Gerhard Sittig, linux-spi-u79uwXL29TY76Z2rM5mHXA
For DT case, spi core will call of_alias_get_id() and set master->bus_num if it
was not set.
Signed-off-by: Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
---
drivers/spi/spi-mpc512x-psc.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c
index 56cead9..3822eef 100644
--- a/drivers/spi/spi-mpc512x-psc.c
+++ b/drivers/spi/spi-mpc512x-psc.c
@@ -465,10 +465,8 @@ static void mpc512x_spi_cs_control(struct spi_device *spi, bool onoff)
gpio_set_value(spi->cs_gpio, onoff);
}
-/* bus_num is used only for the case dev->platform_data == NULL */
static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr,
- u32 size, unsigned int irq,
- s16 bus_num)
+ u32 size, unsigned int irq)
{
struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
struct mpc512x_psc_spi *mps;
@@ -487,7 +485,6 @@ static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr,
if (pdata == NULL) {
mps->cs_control = mpc512x_spi_cs_control;
- master->bus_num = bus_num;
} else {
mps->cs_control = pdata->cs_control;
master->bus_num = pdata->bus_num;
@@ -573,7 +570,6 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *op)
{
const u32 *regaddr_p;
u64 regaddr64, size64;
- s16 id = -1;
regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL);
if (!regaddr_p) {
@@ -582,16 +578,8 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *op)
}
regaddr64 = of_translate_address(op->dev.of_node, regaddr_p);
- /* get PSC id (0..11, used by port_config) */
- id = of_alias_get_id(op->dev.of_node, "spi");
- if (id < 0) {
- dev_err(&op->dev, "no alias id for %s\n",
- op->dev.of_node->full_name);
- return id;
- }
-
return mpc512x_psc_spi_do_probe(&op->dev, (u32) regaddr64, (u32) size64,
- irq_of_parse_and_map(op->dev.of_node, 0), id);
+ irq_of_parse_and_map(op->dev.of_node, 0));
}
static int mpc512x_psc_spi_of_remove(struct platform_device *op)
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: mpc512x-psc: Remove redundant code to get bus_num from DT
2014-02-16 2:43 [PATCH] spi: mpc512x-psc: Remove redundant code to get bus_num from DT Axel Lin
@ 2014-02-16 14:04 ` Gerhard Sittig
2014-02-18 2:04 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Gerhard Sittig @ 2014-02-16 14:04 UTC (permalink / raw)
To: Axel Lin; +Cc: Mark Brown, Anatolij Gustschin, linux-spi-u79uwXL29TY76Z2rM5mHXA
On Sun, Feb 16, 2014 at 10:43 +0800, Axel Lin wrote:
>
> For DT case, spi core will call of_alias_get_id() and set master->bus_num if it
> was not set.
>
> Signed-off-by: Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
Tested-by: Gerhard Sittig <gsi-ynQEQJNshbs@public.gmane.org>
virtually yours
Gerhard Sittig
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office-ynQEQJNshbs@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: mpc512x-psc: Remove redundant code to get bus_num from DT
2014-02-16 2:43 [PATCH] spi: mpc512x-psc: Remove redundant code to get bus_num from DT Axel Lin
2014-02-16 14:04 ` Gerhard Sittig
@ 2014-02-18 2:04 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-02-18 2:04 UTC (permalink / raw)
To: Axel Lin
Cc: Anatolij Gustschin, Gerhard Sittig, linux-spi-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 173 bytes --]
On Sun, Feb 16, 2014 at 10:43:18AM +0800, Axel Lin wrote:
> For DT case, spi core will call of_alias_get_id() and set master->bus_num if it
> was not set.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-18 2:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-16 2:43 [PATCH] spi: mpc512x-psc: Remove redundant code to get bus_num from DT Axel Lin
2014-02-16 14:04 ` Gerhard Sittig
2014-02-18 2:04 ` Mark Brown
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.