@@ -179,34 +179,28 @@ static int l4f00242t03_probe(struct spi_device *spi)
179
179
priv -> spi = spi ;
180
180
181
181
priv -> reset = devm_gpiod_get (& spi -> dev , "reset" , GPIOD_OUT_HIGH );
182
- if (IS_ERR (priv -> reset )) {
183
- dev_err (& spi -> dev ,
184
- "Unable to get the lcd l4f00242t03 reset gpio.\n" );
185
- return PTR_ERR (priv -> reset );
186
- }
182
+ if (IS_ERR (priv -> reset ))
183
+ return dev_err_probe (& spi -> dev , PTR_ERR (priv -> reset ),
184
+ "Unable to get the lcd l4f00242t03 reset gpio.\n" );
187
185
gpiod_set_consumer_name (priv -> reset , "lcd l4f00242t03 reset" );
188
186
189
187
priv -> enable = devm_gpiod_get (& spi -> dev , "enable" , GPIOD_OUT_LOW );
190
- if (IS_ERR (priv -> enable )) {
191
- dev_err (& spi -> dev ,
192
- "Unable to get the lcd l4f00242t03 data en gpio.\n" );
193
- return PTR_ERR (priv -> enable );
194
- }
188
+ if (IS_ERR (priv -> enable ))
189
+ return dev_err_probe (& spi -> dev , PTR_ERR (priv -> enable ),
190
+ "Unable to get the lcd l4f00242t03 data en gpio.\n" );
195
191
gpiod_set_consumer_name (priv -> enable , "lcd l4f00242t03 data enable" );
196
192
197
193
priv -> io_reg = devm_regulator_get (& spi -> dev , "vdd" );
198
- if (IS_ERR (priv -> io_reg )) {
199
- dev_err (& spi -> dev , "%s: Unable to get the IO regulator\n" ,
200
- __func__ );
201
- return PTR_ERR (priv -> io_reg );
202
- }
194
+ if (IS_ERR (priv -> io_reg ))
195
+ return dev_err_probe (& spi -> dev , PTR_ERR (priv -> io_reg ),
196
+ "%s: Unable to get the IO regulator\n" ,
197
+ __func__ );
203
198
204
199
priv -> core_reg = devm_regulator_get (& spi -> dev , "vcore" );
205
- if (IS_ERR (priv -> core_reg )) {
206
- dev_err (& spi -> dev , "%s: Unable to get the core regulator\n" ,
207
- __func__ );
208
- return PTR_ERR (priv -> core_reg );
209
- }
200
+ if (IS_ERR (priv -> core_reg ))
201
+ return dev_err_probe (& spi -> dev , PTR_ERR (priv -> core_reg ),
202
+ "%s: Unable to get the core regulator\n" ,
203
+ __func__ );
210
204
211
205
priv -> ld = devm_lcd_device_register (& spi -> dev , "l4f00242t03" , & spi -> dev ,
212
206
priv , & l4f_ops );
0 commit comments