mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexey Galakhov <agalakhov@gmail.com>
Cc: barebox@lists.infradead.org, Juergen Beisert <jbe@pengutronix.de>
Subject: Re: [PATCH 2/7] Split S3C generic and S3C24xx specific code
Date: Fri, 18 May 2012 10:38:35 +0200	[thread overview]
Message-ID: <20120518083835.GN30400@pengutronix.de> (raw)
In-Reply-To: <CA+LT+-QJift5r5cBk6KruuXA1WBZKfTRGpv0Grr83+npmw+jUw@mail.gmail.com>

On Fri, May 18, 2012 at 12:49:25PM +0600, Alexey Galakhov wrote:
> > Mostly a matter of taste. But sometimes these functions should use a common
> > name: when they are used by a shared driver.
> > If you call a S3C2440 related function by a S3C2440 related driver or board
> > file, we should use a SoC specific name. When we call a function from a
> > driver used for S3C2440 *and* S3C6410 it should use a non SoC specific name.
> > This is a "should" and I fear my S3C24xx code is not perfect in this way.
> 
> What if...
> 
> int s3c24xx_get_pclk(void);
> int s3c64xx_get_pclk_msys(void);
> int s3c64xx_get_pclk_psys(void);
> 
> And in some driver:
> 
> #ifdef ...
>     x = s3c24xx_get_pclk();
> #else
>     x = s3c64xx_get_pclk_msys();
> #endif
> 
> In some other driver:
> 
> #ifdef ...
>     x = s3c24xx_get_pclk();
> #else
>     x = s3c64xx_get_pclk_psys();
> #endif
> 
> Ho to do that correctly? Right now I prefer that way:
> 
> int s3c_get_some_driver_clk(void);
> defined somewhere in arch/***

Me too. As said, ideally we would have a clk_get(dev, id), but we don't
have this atm. (We have it on Atmel, you could do the same, but I don't
ask you to do this if you don't want to)

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

  reply	other threads:[~2012-05-18  8:38 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15 13:20 [PATCHv3 0/7] Cleaned up version of S5PV210 code Alexey Galakhov
2012-05-15 13:20 ` [PATCH 1/7] Make S3C24xx config options available for all S3Cs Alexey Galakhov
2012-05-15 13:20 ` [PATCH 2/7] Split S3C generic and S3C24xx specific code Alexey Galakhov
2012-05-17 17:52   ` Sascha Hauer
2012-05-17 18:33     ` Alexey Galakhov
2012-05-17 19:49       ` Juergen Beisert
2012-05-18  6:49         ` Alexey Galakhov
2012-05-18  8:38           ` Sascha Hauer [this message]
2012-05-18  9:06             ` Alexey Galakhov
2012-05-18  8:35       ` Sascha Hauer
2012-05-18  9:43     ` [PATCHv4 0/7] S5PV210 support (upd.) Alexey Galakhov
2012-05-18  9:43       ` [PATCH 1/7] Make S3C24xx config options available for all S3Cs Alexey Galakhov
2012-05-18  9:43       ` [PATCHv4 2/7] Split S3C generic and S3C24xx specific code Alexey Galakhov
2012-05-18  9:43       ` [PATCH 3/7] Add support for Samsung S5P architecture (S5PV210) Alexey Galakhov
2012-05-18  9:43       ` [PATCH 4/7] S5P boot header and image generator Alexey Galakhov
2012-05-18  9:43       ` [PATCHv4 5/7] S5P lowlevel clock init Alexey Galakhov
2012-05-18  9:43       ` [PATCHv4 6/7] S5P DRAM support Alexey Galakhov
2012-05-21 20:02         ` Sascha Hauer
2012-05-22  9:17           ` Alexey Galakhov
2012-05-22 18:29             ` Sascha Hauer
2012-05-22 19:12               ` Alexey Galakhov
2012-05-18  9:43       ` [PATCHv4 7/7] Add FriendlyArm Tiny210 board (S5PV210) Alexey Galakhov
2012-05-21 20:00       ` [PATCHv4 0/7] S5PV210 support (upd.) Sascha Hauer
2012-05-22  9:18         ` Alexey Galakhov
2012-05-15 13:20 ` [PATCH 3/7] Add support for Samsung S5P architecture (S5PV210) Alexey Galakhov
2012-05-15 13:20 ` [PATCH 4/7] S5P boot header and image generator Alexey Galakhov
2012-05-15 13:20 ` [PATCH 5/7] S5P lowlevel clock init Alexey Galakhov
2012-05-15 13:20 ` [PATCH 6/7] S5P DRAM support Alexey Galakhov
2012-05-15 13:20 ` [PATCH 7/7] Add FriendlyArm Tiny210 board (S5PV210) Alexey Galakhov

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=20120518083835.GN30400@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=agalakhov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=jbe@pengutronix.de \
    /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