diff mbox

i2c/nuc900: fix ancient build error

Message ID 1399560990-1402858-11-git-send-email-arnd@arndb.de
State Superseded
Headers show

Commit Message

Arnd Bergmann May 8, 2014, 2:56 p.m. UTC
As far as I can tell, this driver must have produced this error
for as long as it has been merged into the mainline kernel, but
it was never part of the normal build tests:

drivers/i2c/busses/i2c-nuc900.c: In function 'nuc900_i2c_probe':
drivers/i2c/busses/i2c-nuc900.c:601:17: error: request for member 'apbfreq' in something not a structure or union
  ret = (i2c->clk.apbfreq)/(pdata->bus_freq * 5) - 1;
                 ^

This is an attempt to get the driver to build and possibly
work correctly, although I do wonder whether we should just
remove it, as it has clearly never worked.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-i2c@vger.kernel.org
Cc: Wan ZongShun <mcuos.com@gmail.org>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Baruch Siach <baruch@tkos.co.il>
---
 drivers/i2c/busses/i2c-nuc900.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marek Roszko May 9, 2014, 10:23 p.m. UTC | #1
"[PATCH] NUC900: patch for implement clk_get_rate"
https://lkml.org/lkml/2010/6/15/147

This patch would have fixed the apbfreq not being a real struct member
and would also explain why clk_get_rate is called without using it's
return value in the line above what you have.

From 2010, so it got dropped somewhere and ignored/abandoned
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfram Sang May 14, 2014, 4:27 p.m. UTC | #2
On Thu, May 08, 2014 at 04:56:22PM +0200, Arnd Bergmann wrote:
> As far as I can tell, this driver must have produced this error
> for as long as it has been merged into the mainline kernel, but
> it was never part of the normal build tests:
> 
> drivers/i2c/busses/i2c-nuc900.c: In function 'nuc900_i2c_probe':
> drivers/i2c/busses/i2c-nuc900.c:601:17: error: request for member 'apbfreq' in something not a structure or union
>   ret = (i2c->clk.apbfreq)/(pdata->bus_freq * 5) - 1;
>                  ^
> 
> This is an attempt to get the driver to build and possibly
> work correctly, although I do wonder whether we should just
> remove it, as it has clearly never worked.

I'd go for removing. For this platform, the last patch which was not a
generic cleanup seems to be from late 2011?
Arnd Bergmann May 14, 2014, 6:14 p.m. UTC | #3
On Wednesday 14 May 2014 18:27:25 Wolfram Sang wrote:
> On Thu, May 08, 2014 at 04:56:22PM +0200, Arnd Bergmann wrote:
> > As far as I can tell, this driver must have produced this error
> > for as long as it has been merged into the mainline kernel, but
> > it was never part of the normal build tests:
> > 
> > drivers/i2c/busses/i2c-nuc900.c: In function 'nuc900_i2c_probe':
> > drivers/i2c/busses/i2c-nuc900.c:601:17: error: request for member 'apbfreq' in something not a structure or union
> >   ret = (i2c->clk.apbfreq)/(pdata->bus_freq * 5) - 1;
> >                  ^
> > 
> > This is an attempt to get the driver to build and possibly
> > work correctly, although I do wonder whether we should just
> > remove it, as it has clearly never worked.
> 
> I'd go for removing. For this platform, the last patch which was not a
> generic cleanup seems to be from late 2011?

Ah, you mean removing the entire platform? I guess we could do that
as well, but I was really thinking of just removing the i2c driver.

For the moment, I'd leave this up to Wan ZongShun. He has in the past
at least replied to emails about the platform, even though there hasn't
been any new development.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfram Sang May 14, 2014, 7:17 p.m. UTC | #4
> For the moment, I'd leave this up to Wan ZongShun. He has in the past
> at least replied to emails about the platform, even though there hasn't
> been any new development.

Agreed. Let's wait for his response. If there is none, I'll think about
removing the driver.
Wolfram Sang May 21, 2014, 10:49 a.m. UTC | #5
On Wed, May 14, 2014 at 09:17:49PM +0200, Wolfram Sang wrote:
> 
> > For the moment, I'd leave this up to Wan ZongShun. He has in the past
> > at least replied to emails about the platform, even though there hasn't
> > been any new development.
> 
> Agreed. Let's wait for his response. If there is none, I'll think about
> removing the driver.
> 

Wan ZongShun, final call before this driver gets removed next week.
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-nuc900.c b/drivers/i2c/busses/i2c-nuc900.c
index 36394d7..e3e9f95 100644
--- a/drivers/i2c/busses/i2c-nuc900.c
+++ b/drivers/i2c/busses/i2c-nuc900.c
@@ -598,7 +598,7 @@  static int nuc900_i2c_probe(struct platform_device *pdev)
 
 	clk_get_rate(i2c->clk);
 
-	ret = (i2c->clk.apbfreq)/(pdata->bus_freq * 5) - 1;
+	ret = clk_get_rate(i2c->clk)/(pdata->bus_freq * 5) - 1;
 	writel(ret & 0xffff, i2c->regs + DIVIDER);
 
 	/* find the IRQ for this unit (note, this relies on the init call to