From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: John Crispin <blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>,
Ralf Baechle <ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
John Crispin <blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>,
Thomas Langer
<thomas.langer-th3ZBGNqt+7QT0dZR+AlfA@public.gmane.org>,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH V3 16/17] SPI: MIPS: lantiq: add FALCON spi driver
Date: Sat, 19 May 2012 23:16:51 -0600 [thread overview]
Message-ID: <20120520051651.388013E03B8@localhost> (raw)
In-Reply-To: <1337025642-31194-1-git-send-email-blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
On Mon, 14 May 2012 22:00:42 +0200, John Crispin <blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org> wrote:
> From: Thomas Langer <thomas.langer-th3ZBGNqt+7QT0dZR+AlfA@public.gmane.org>
>
> The external bus unit (EBU) found on the FALCON SoC has spi emulation that is
> designed for serial flash access. This driver has only been tested with m25p80
> type chips. The hardware has no support for other types of spi peripherals.
>
> Signed-off-by: Thomas Langer <thomas.langer-th3ZBGNqt+7QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: John Crispin <blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
> Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> ---
> This patch was previously Acked in V2 by Grant
> http://www.mail-archive.com/spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org/msg07874.html
Which mostly stands except for (something I didn't notice before)....
> +static int __devinit falcon_sflash_probe(struct platform_device *pdev)
> +{
> + struct falcon_sflash *priv;
> + const __be32 *prop;
> + struct spi_master *master;
> + int ret, len;
> +
> + if (ltq_boot_select() != BS_SPI) {
> + dev_err(&pdev->dev, "invalid bootstrap options\n");
> + return -ENODEV;
> + }
> +
> + master = spi_alloc_master(&pdev->dev, sizeof(*priv));
> + if (!master)
> + return -ENOMEM;
> +
> + priv = spi_master_get_devdata(master);
> + priv->master = master;
> +
> + master->mode_bits = SPI_MODE_3;
> + master->num_chipselect = 1;
> + master->bus_num = -1;
> + master->setup = falcon_sflash_setup;
> + master->prepare_transfer_hardware = falcon_sflash_prepare_xfer;
> + master->transfer_one_message = falcon_sflash_xfer_one;
> + master->unprepare_transfer_hardware = falcon_sflash_unprepare_xfer;
> + master->dev.of_node = pdev->dev.of_node;
> +
> + prop = of_get_property(pdev->dev.of_node, "busnum", &len);
> + if (prop && (len == sizeof(*prop)))
> + master->bus_num = be32_to_cpup(prop);
Drop this bit. spi bus numbers are dynamically assigned for DT usage.
Using a property to override the bus number should not be done.
Userspace can determine the bus number for a given device from sysfs.
If you still **really** need a bus to have a specific number, then the
correct way of handling it is to use a property in the /aliases node,
and there is some infrastructure in drivers/of/base.c. Look for
of_alias_get_id().
g.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
prev parent reply other threads:[~2012-05-20 5:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-14 20:00 [PATCH V3 16/17] SPI: MIPS: lantiq: add FALCON spi driver John Crispin
[not found] ` <1337025642-31194-1-git-send-email-blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2012-05-20 5:16 ` Grant Likely [this message]
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=20120520051651.388013E03B8@localhost \
--to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
--cc=blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org \
--cc=linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
--cc=ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=thomas.langer-th3ZBGNqt+7QT0dZR+AlfA@public.gmane.org \
/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 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).