mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2] i2c-imx: Add missing preporcessor directives
Date: Sat, 15 Aug 2015 22:53:49 +0200	[thread overview]
Message-ID: <20150815205349.GA28427@ravnborg.org> (raw)
In-Reply-To: <1439657071-26736-1-git-send-email-andrew.smirnov@gmail.com>

Hi Andrey.

On Sat, Aug 15, 2015 at 09:44:31AM -0700, Andrey Smirnov wrote:
> On non-PowerPC platforms call to i2c_fsl_set_clk() will try to obtain
> I2C clock freqency from i2c_fsl->clk, however that field would not be
> initialized if CONFIG_COMMON_CLK is not set. This patch makes sure
> that i2c_fls_set_clk() is a no-op on non-PPC targets when
> CONFIG_COMMON_CLK is not set

Per the other mail we will never hit this case.
So you add an ifdef that never will be used,
because this driver is either for IMX (which uses COMMON_CLK) or PowerPC.

There is this snip from the driver:

#ifdef CONFIG_COMMON_CLK
        i2c_fsl->clk = clk_get(pdev, NULL);
        if (IS_ERR(i2c_fsl->clk))
                return PTR_ERR(i2c_fsl->clk);
#endif

You may have been inspired by that.
To the best of my understanding the ifdef can be dropped,
because clk_dev() is always defined, but retinr NULL if
HAVE_CLK is not defined.
I assume thsi is the case for PowerPC.

So the better fix would be to get rid of this ifdet,
rather than introducing a new one.

	Sam

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-08-15 20:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-15 16:44 Andrey Smirnov
2015-08-15 20:53 ` Sam Ravnborg [this message]
2015-08-15 23:33   ` Andrey Smirnov
2015-08-17  8:39     ` Lucas Stach

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=20150815205349.GA28427@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.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