From: Arnd Bergmann <arnd@arndb.de>
To: Kevin Cernekee <cernekee@gmail.com>
Cc: gregkh@linuxfoundation.org, jslaby@suse.cz, robh@kernel.org,
grant.likely@linaro.org, geert@linux-m68k.org,
f.fainelli@gmail.com, mbizon@freebox.fr, jogo@openwrt.org,
linux-mips@linux-mips.org, linux-serial@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH V2 4/9] Documentation: DT: Add entries for bcm63xx UART
Date: Mon, 20 Oct 2014 23:25:10 +0200 [thread overview]
Message-ID: <2100909.UrHPDWWSai@wuerfel> (raw)
In-Reply-To: <6216923.cK1phqtEXn@wuerfel>
On Monday 20 October 2014 23:20:08 Arnd Bergmann wrote:
>
> In this example, the clock output name of the clock provider is
> the same as the clock input of the consumer, that is almost always
> a bug and would not be a good example at all.
>
>
Ah, found the bug: the MIPS code is written to ignore the device
and just look up a global clock name:
struct clk *clk_get(struct device *dev, const char *id)
{
if (!strcmp(id, "enet0"))
return &clk_enet0;
if (!strcmp(id, "enet1"))
return &clk_enet1;
if (!strcmp(id, "enetsw"))
return &clk_enetsw;
if (!strcmp(id, "ephy"))
return &clk_ephy;
if (!strcmp(id, "usbh"))
return &clk_usbh;
if (!strcmp(id, "usbd"))
return &clk_usbd;
if (!strcmp(id, "spi"))
return &clk_spi;
if (!strcmp(id, "hsspi"))
return &clk_hsspi;
if (!strcmp(id, "xtm"))
return &clk_xtm;
if (!strcmp(id, "periph"))
return &clk_periph;
if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm"))
return &clk_pcm;
if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec"))
return &clk_ipsec;
if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie"))
return &clk_pcie;
return ERR_PTR(-ENOENT);
}
This should be changed to use the drivers/clk/clkdev.c lookup code if
you want to share drivers between architectures.
In particular, the "enet0"/"enet1" clock name makes no sense -- the
clock input name should be independent of the instance, aside from
the question of which output of the provider it is wired up to.
Arnd
next prev parent reply other threads:[~2014-10-20 21:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-20 20:53 [PATCH V2 0/9] bcm63xx_uart and of-serial updates Kevin Cernekee
2014-10-20 20:54 ` [PATCH V2 1/9] tty: serial: bcm63xx: Allow bcm63xx_uart to be built on other platforms Kevin Cernekee
2014-10-20 20:54 ` [PATCH V2 2/9] tty: serial: bcm63xx: Update the Kconfig help text Kevin Cernekee
2014-10-20 20:54 ` [PATCH V2 3/9] tty: serial: bcm63xx: Fix typo in MODULE_DESCRIPTION Kevin Cernekee
2014-10-20 20:54 ` [PATCH V2 4/9] Documentation: DT: Add entries for bcm63xx UART Kevin Cernekee
2014-10-20 21:20 ` Arnd Bergmann
2014-10-20 21:25 ` Arnd Bergmann [this message]
2014-10-20 22:53 ` Florian Fainelli
2014-10-21 5:49 ` Arnd Bergmann
2014-10-20 20:54 ` [PATCH V2 5/9] tty: serial: bcm63xx: Enable DT earlycon support Kevin Cernekee
2014-10-20 20:54 ` [PATCH V2 6/9] tty: serial: bcm63xx: Eliminate unnecessary request/release functions Kevin Cernekee
2014-10-20 20:54 ` [PATCH V2 7/9] tty: serial: of-serial: Suppress warnings if OF earlycon is invoked twice Kevin Cernekee
2014-10-20 20:54 ` [PATCH V2 8/9] tty: serial: of-serial: Allow OF earlycon to default to "on" Kevin Cernekee
2014-10-20 20:54 ` [PATCH V2 9/9] MAINTAINERS: Add entry for rp2 (Rocketport Express/Infinity) driver Kevin Cernekee
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=2100909.UrHPDWWSai@wuerfel \
--to=arnd@arndb.de \
--cc=cernekee@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=geert@linux-m68k.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=jogo@openwrt.org \
--cc=jslaby@suse.cz \
--cc=linux-mips@linux-mips.org \
--cc=linux-serial@vger.kernel.org \
--cc=mbizon@freebox.fr \
--cc=robh@kernel.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).