[U-Boot] [PATCH v5 2/2] hwmon: do not init sensors on startup

Wolfgang Denk wd at denx.de
Thu Aug 4 23:31:07 CEST 2011


Dear Heiko Schocher,

In message <1312207303-25153-1-git-send-email-hs at denx.de> you wrote:
> The U-Boot Design Principles[1] clearly say:
> 
>   Initialize devices only when they are needed within U-Boot, i.e. don't
>   initialize the Ethernet interface(s) unless U-Boot performs a download
>   over Ethernet; don't initialize any IDE or USB devices unless U-Boot
>   actually tries to load files from these, etc. (and don't forget to
>   shut down these devices after using them - otherwise nasty things may
>   happen when you try to boot your OS).
> 
> So, do not initialize and read the sensors on startup.
> 
> Signed-off-by: Heiko Schocher <hs at denx.de>
> cc: Wolfgang Denk <wd at denx.de>
> cc: Holger Brunck <holger.brunck at keymile.com>
> 
> ---
> - changes since v1
>   add comments from Wolfgang Denk
>   use BUILD_BUG_ON to create a compileerror if there are
>   defined more than 32 sensors.
> 
> - changes since v2
>   don;t include genutils.h, as macro is now in common.h
> 
> - changes since v3
>   do not initialize static sensor_initialized with 0
> 
> - changes since v4
>   revert change for v4. Just drop the initialization
>   of sensor_initialized with 0.
> 
>  arch/powerpc/lib/board.c |    3 ---
>  common/cmd_dtt.c         |   16 ++++++++++++++--
>  drivers/hwmon/adm1021.c  |   27 +++------------------------
>  drivers/hwmon/adt7460.c  |    2 +-
>  drivers/hwmon/ds1621.c   |   19 +------------------
>  drivers/hwmon/ds1775.c   |   19 +------------------
>  drivers/hwmon/lm63.c     |   19 +------------------
>  drivers/hwmon/lm73.c     |   20 ++------------------
>  drivers/hwmon/lm75.c     |   29 ++---------------------------
>  drivers/hwmon/lm81.c     |   21 ++-------------------
>  include/dtt.h            |    2 +-
>  11 files changed, 28 insertions(+), 149 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The most difficult thing in the world is to know how to  do  a  thing
and to watch someone else doing it wrong, without commenting.
                                                        -- T.H. White


More information about the U-Boot mailing list