linux-mips
[Top] [All Lists]

Re: [PATCH] generic clk API implementation for MIPS

To: hch@lst.de
Subject: Re: [PATCH] generic clk API implementation for MIPS
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Thu, 28 Jun 2007 18:26:46 +0900 (JST)
Cc: vagabon.xyz@gmail.com, linux-mips@linux-mips.org, ralf@linux-mips.org
In-reply-to: <20070628083725.GA23394@lst.de>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20070627153932.GA6016@lst.de> <20070628.112223.96686654.nemoto@toshiba-tops.co.jp> <20070628083725.GA23394@lst.de>
Sender: linux-mips-bounce@linux-mips.org
On Thu, 28 Jun 2007 10:37:25 +0200, Christoph Hellwig <hch@lst.de> wrote:
> > But I gave up for now ;) I will leave all implementation for platform
> > code.
> 
> I really dislike duplicating thing over architectures.  If you copy code
> from another architecture the first though should be 'could and should
> this be generic ?'.  So please try to get this lifted to common code
> instead of duplicating it.

OK, I see.  But now I think the best thing we can provide as generic
is only "no clocks" implementation.

Do you think it is worth to put into lib/ directory?

struct clk *__weak clk_get(struct device *dev, const char *id)
{
        return ERR_PTR(-ENOENT);
}
EXPORT_SYMBOL(clk_get);

int __weak clk_enable(struct clk *clk)
{
        return 0;
}
EXPORT_SYMBOL(clk_enable);

void __weak clk_disable(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_disable);

unsigned long __weak clk_get_rate(struct clk *clk)
{
        return 0;
}
EXPORT_SYMBOL(clk_get_rate);

void __weak clk_put(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_put);


This might conflict with some current implementations which export
these APIs as EXPORT_SYMBOL_GPL...

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>