File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ static void max17040_get_online(struct i2c_client *client)
148148{
149149 struct max17040_chip * chip = i2c_get_clientdata (client );
150150
151- if (chip -> pdata -> battery_online )
151+ if (chip -> pdata && chip -> pdata -> battery_online )
152152 chip -> online = chip -> pdata -> battery_online ();
153153 else
154154 chip -> online = 1 ;
@@ -158,7 +158,8 @@ static void max17040_get_status(struct i2c_client *client)
158158{
159159 struct max17040_chip * chip = i2c_get_clientdata (client );
160160
161- if (!chip -> pdata -> charger_online || !chip -> pdata -> charger_enable ) {
161+ if (!chip -> pdata || !chip -> pdata -> charger_online
162+ || !chip -> pdata -> charger_enable ) {
162163 chip -> status = POWER_SUPPLY_STATUS_UNKNOWN ;
163164 return ;
164165 }
You can’t perform that action at this time.
0 commit comments