extend work around boot-time ordering on GTA01
authorTim Niemeyer <reddog@mastersword.de>
Thu, 26 Mar 2009 04:19:15 +0000 (01:19 -0300)
committerWerner Almesberger <werner@openmoko.org>
Thu, 26 Mar 2009 04:24:28 +0000 (01:24 -0300)
[ Werner: Documentation/CodingStyle lines 166 and 448, put blank line after
  local variables. ]

Signed-off-by: Tim Niemeyer <reddog@mastersword.de>
Signed-off-by: Werner Almesberger <werner@openmoko.org>
drivers/power/pcf50606-charger.c

index 0f2aeda..fb02a79 100644 (file)
@@ -36,6 +36,13 @@ struct pcf50606_mbc {
 void pcf50606_charge_fast(struct pcf50606 *pcf, int on)
 {
        struct pcf50606_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev);
+       /* this is a fix to work around boot-time ordering problems if
+       * the s3c2410_udc is initialized before the pcf50606 mbc is
+       * ready */
+       if (!mbc)
+       {
+               return;
+       }
 
        if (on) {
                pcf50606_reg_set_bit_mask(pcf, PCF50606_REG_MBCC1,