@@ -208,10 +208,8 @@ static int mp3309c_parse_fwnode(struct mp3309c_chip *chip,
208
208
unsigned int num_levels , tmp_value ;
209
209
struct device * dev = chip -> dev ;
210
210
211
- if (!dev_fwnode (dev )) {
212
- dev_err (dev , "failed to get firmware node\n" );
213
- return - ENODEV ;
214
- }
211
+ if (!dev_fwnode (dev ))
212
+ return dev_err_probe (dev , - ENODEV , "failed to get firmware node\n" );
215
213
216
214
/*
217
215
* Dimming mode: the MP3309C provides two dimming control mode:
@@ -287,8 +285,7 @@ static int mp3309c_parse_fwnode(struct mp3309c_chip *chip,
287
285
if (ret )
288
286
pdata -> default_brightness = pdata -> max_brightness ;
289
287
if (pdata -> default_brightness > pdata -> max_brightness ) {
290
- dev_err (chip -> dev ,
291
- "default brightness exceeds max brightness\n" );
288
+ dev_err_probe (dev , - ERANGE , "default brightness exceeds max brightness\n" );
292
289
pdata -> default_brightness = pdata -> max_brightness ;
293
290
}
294
291
@@ -329,16 +326,15 @@ static int mp3309c_parse_fwnode(struct mp3309c_chip *chip,
329
326
330
327
static int mp3309c_probe (struct i2c_client * client )
331
328
{
332
- struct mp3309c_platform_data * pdata = dev_get_platdata (& client -> dev );
329
+ struct device * dev = & client -> dev ;
330
+ struct mp3309c_platform_data * pdata = dev_get_platdata (dev );
333
331
struct mp3309c_chip * chip ;
334
332
struct backlight_properties props ;
335
333
struct pwm_state pwmstate ;
336
334
int ret ;
337
335
338
- if (!i2c_check_functionality (client -> adapter , I2C_FUNC_I2C )) {
339
- dev_err (& client -> dev , "failed to check i2c functionality\n" );
340
- return - EOPNOTSUPP ;
341
- }
336
+ if (!i2c_check_functionality (client -> adapter , I2C_FUNC_I2C ))
337
+ return dev_err_probe (dev , - EOPNOTSUPP , "failed to check i2c functionality\n" );
342
338
343
339
chip = devm_kzalloc (& client -> dev , sizeof (* chip ), GFP_KERNEL );
344
340
if (!chip )
0 commit comments