static void ab8500_power_supply_changed(struct ab8500_charger *di,
                                        struct power_supply *psy)
 {
+       /*
+        * This happens if we get notifications or interrupts and
+        * the platform has been configured not to support one or
+        * other type of charging.
+        */
+       if (!psy)
+               return;
+
        if (di->autopower_cfg) {
                if (!di->usb.charger_connected &&
                    !di->ac.charger_connected &&
                if (!connected)
                        di->flags.vbus_drop_end = false;
 
-               sysfs_notify(&di->usb_chg.psy->dev.kobj, NULL, "present");
+               /*
+                * Sometimes the platform is configured not to support
+                * USB charging and no psy has been created, but we still
+                * will get these notifications.
+                */
+               if (di->usb_chg.psy) {
+                       sysfs_notify(&di->usb_chg.psy->dev.kobj, NULL,
+                                    "present");
+               }
 
                if (connected) {
                        mutex_lock(&di->charger_attached_mutex);