forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/gpu/drm/i2c/sil164_drv.c
....@@ -26,9 +26,10 @@
2626
2727 #include <linux/module.h>
2828
29
-#include <drm/drmP.h>
30
-#include <drm/drm_crtc_helper.h>
29
+#include <drm/drm_drv.h>
3130 #include <drm/drm_encoder_slave.h>
31
+#include <drm/drm_print.h>
32
+#include <drm/drm_probe_helper.h>
3233 #include <drm/i2c/sil164.h>
3334
3435 struct sil164_priv {
....@@ -43,7 +44,7 @@
4344 ((struct sil164_priv *)to_encoder_slave(x)->slave_priv)
4445
4546 #define sil164_dbg(client, format, ...) do { \
46
- if (drm_debug & DRM_UT_KMS) \
47
+ if (drm_debug_enabled(DRM_UT_KMS)) \
4748 dev_printk(KERN_DEBUG, &client->dev, \
4849 "%s: " format, __func__, ## __VA_ARGS__); \
4950 } while (0)
....@@ -392,7 +393,7 @@
392393 return NULL;
393394 }
394395
395
- return i2c_new_device(adap, &info);
396
+ return i2c_new_client_device(adap, &info);
396397 }
397398
398399 static int
....@@ -401,6 +402,7 @@
401402 struct drm_encoder_slave *encoder)
402403 {
403404 struct sil164_priv *priv;
405
+ struct i2c_client *slave_client;
404406
405407 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
406408 if (!priv)
....@@ -409,7 +411,9 @@
409411 encoder->slave_priv = priv;
410412 encoder->slave_funcs = &sil164_encoder_funcs;
411413
412
- priv->duallink_slave = sil164_detect_slave(client);
414
+ slave_client = sil164_detect_slave(client);
415
+ if (!IS_ERR(slave_client))
416
+ priv->duallink_slave = slave_client;
413417
414418 return 0;
415419 }