All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] smc911x: split out useful defines/functions into local header
Date: Sun, 22 Feb 2009 22:56:13 -0800	[thread overview]
Message-ID: <49A2488D.4070207@gmail.com> (raw)
In-Reply-To: <1231259684-22134-1-git-send-email-vapier@gentoo.org>

Hi Mike,

Sorry I didn't address this earlier.

Mike Frysinger wrote:
> The smc911x driver has a lot of useful defines/functions which can be used
> by pieces of code (such as example eeprom programmers).  Rather than
> forcing each place to duplicate these defines/functions, split them out
> of the smdc911x driver into a local header.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> CC: Sascha Hauer <s.hauer@pengutronix.de>
> CC: Guennadi Liakhovetski <lg@denx.de>
> CC: Magnus Lilja <lilja.magnus@gmail.com>
> CC: Ben Warren <biggerbadderben@gmail.com>
> ---
> v2
> 	- add includes for types utilized in smc911x.h
>
>  drivers/net/smc911x.c |  452 +---------------------------------------------
>  drivers/net/smc911x.h |  489 +++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 491 insertions(+), 450 deletions(-)
>  create mode 100644 drivers/net/smc911x.h
>
> diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
> index 648c94c..192bd96 100644
> --- a/drivers/net/smc911x.c
> +++ b/drivers/net/smc911x.c
> @@ -27,35 +27,7 @@
>  #include <net.h>
>  #include <miiphy.h>
>  
> -#if defined (CONFIG_DRIVER_SMC911X_32_BIT) && \
> -	defined (CONFIG_DRIVER_SMC911X_16_BIT)
> -#error "SMC911X: Only one of CONFIG_DRIVER_SMC911X_32_BIT and \
> -	CONFIG_DRIVER_SMC911X_16_BIT shall be set"
> -#endif
> -
> -#if defined (CONFIG_DRIVER_SMC911X_32_BIT)
> -static inline u32 reg_read(u32 addr)
> -{
> -	return *(volatile u32*)addr;
> -}
> -static inline void reg_write(u32 addr, u32 val)
> -{
> -	*(volatile u32*)addr = val;
> -}
> -#elif defined (CONFIG_DRIVER_SMC911X_16_BIT)
> -static inline u32 reg_read(u32 addr)
> -{
> -	volatile u16 *addr_16 = (u16 *)addr;
> -	return ((*addr_16 & 0x0000ffff) | (*(addr_16 + 1) << 16));
> -}
> -static inline void reg_write(u32 addr, u32 val)
> -{
> -	*(volatile u16*)addr = (u16)val;
> -	*(volatile u16*)(addr + 2) = (u16)(val >> 16);
> -}
> -#else
> -#error "SMC911X: undefined bus width"
> -#endif /* CONFIG_DRIVER_SMC911X_16_BIT */
> +#include "smc911x.h"
>  
>   
This hunk doesn't apply any more.  Commit 
890a02e8ee6b8c26a6e3e505e1a2d29cd73aa6f6 in late November changed 
several of these functions to weak.

<snip>

regards,
Ben

  parent reply	other threads:[~2009-02-23  6:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-22  7:56 [U-Boot] [PATCH 1/2] smc911x: split out useful defines/functions into local header Mike Frysinger
2008-12-22  7:56 ` [U-Boot] [PATCH 2/2] smc911x_eeprom: new example app for managing newer SMC parts Mike Frysinger
2009-01-05 15:17   ` Magnus Lilja
2009-01-05 15:23   ` Magnus Lilja
2009-02-17 23:35   ` Wolfgang Denk
2009-01-05 15:13 ` [U-Boot] [PATCH 1/2] smc911x: split out useful defines/functions into local header Magnus Lilja
2009-01-06 16:34   ` [U-Boot] [PATCH v2] " Mike Frysinger
2009-02-17 23:37     ` Wolfgang Denk
2009-02-23  6:56     ` Ben Warren [this message]
2009-02-23 15:29       ` [U-Boot] [PATCH v3] " Mike Frysinger
2009-02-23 15:44         ` Guennadi Liakhovetski
2009-02-23 15:47           ` Mike Frysinger
2009-02-23 16:09             ` Guennadi Liakhovetski
2009-02-25  7:17         ` Ben Warren
2009-02-25  8:01           ` Wolfgang Denk
2009-02-25  8:00         ` Wolfgang Denk

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=49A2488D.4070207@gmail.com \
    --to=biggerbadderben@gmail.com \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.