mipi_dsi_device_register_full() never returns NULL pointer, it will return ERR_PTR() when it fails, so replace the check with IS_ERR().
Unified · Split
| @@ -1254,9 +1254,9 @@ static int nt36523_probe(struct mipi_dsi_device *dsi) · 1253 unmodified lines | |||
| 1254 | return dev_err_probe(dev, -EPROBE_DEFER, "cannot get secondary DSI host\n"); | 1254 | return dev_err_probe(dev, -EPROBE_DEFER, "cannot get secondary DSI host\n"); |
| 1255 | 1255 | ||
| 1256 | pinfo->dsi[1] = mipi_dsi_device_register_full(dsi1_host, info); | 1256 | pinfo->dsi[1] = mipi_dsi_device_register_full(dsi1_host, info); |
| 1257 | if (!pinfo->dsi[1]) { | 1257 | if (IS_ERR(pinfo->dsi[1])) { |
| 1258 | dev_err(dev, "cannot get secondary DSI device\n"); | 1258 | dev_err(dev, "cannot get secondary DSI device\n"); |
| 1259 | return -ENODEV; | 1259 | return PTR_ERR(pinfo->dsi[1]); |
| 1260 | } | 1260 | } |
| 1261 | } | 1261 | } |
| 1262 | 1262 | ||