Skip to contentSkip to conversation

gpu: don't print error when adding adapter fails

PATCH In review Wolfram Sang 2 participants 7 messages Aug 9, 2016 – Aug 10, 2016

Subsystems (10)
lore
Share & tools
lore
#0 lore raw

cover gpu: don't print error when adding adapter fails

Since v4.8-rc1, the I2C core will print detailed information when adding an I2C adapter fails. So, drivers can skip this now.

Should go via subsystem tree, I'd think.

Wolfram Sang (5):
gpu: drm: amd: amdgpu: amdgpu_i2c: don't print error when adding
adapter fails
gpu: drm: mediatek: mtk_hdmi_ddc: don't print error when adding
adapter fails
gpu: drm: msm: hdmi: hdmi_i2c: don't print error when adding adapter
fails
gpu: drm: radeon: radeon_i2c: don't print error when adding adapter
fails
gpu: drm: rockchip: inno_hdmi: don't print error when adding adapter
fails

 drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 4 +---
 drivers/gpu/drm/mediatek/mtk_hdmi_ddc.c | 4 +---
 drivers/gpu/drm/msm/hdmi/hdmi_i2c.c     | 5 +----
 drivers/gpu/drm/radeon/radeon_i2c.c     | 8 ++------
 drivers/gpu/drm/rockchip/inno_hdmi.c    | 1 -
 5 files changed, 5 insertions(+), 17 deletions(-)
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/5 gpu: drm: amd: amdgpu: amdgpu_i2c: don't print error when adding adapter fails

The core will do this for us now.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c +1 -3
index 31a676376d732a..c93a92a840ead1 100644
@@ -186,10 +186,8 @@ struct amdgpu_i2c_chan *amdgpu_i2c_create(struct drm_device *dev,
 			 "AMDGPU i2c hw bus %s", name);
 		i2c->adapter.algo = &amdgpu_atombios_i2c_algo;
 		ret = i2c_add_adapter(&i2c->adapter);
-		if (ret) {
-			DRM_ERROR("Failed to register hw i2c %s\n", name);
+		if (ret)
 			goto out_free;
-		}
 	} else {
 		/* set the amdgpu bit adapter */
 		snprintf(i2c->adapter.name, sizeof(i2c->adapter.name),
Signature · 1 line
2.8.1
#2 lore raw

PATCH 2/5 gpu: drm: mediatek: mtk_hdmi_ddc: don't print error when adding adapter fails

In reply to Wolfram Sang

The core will do this for us now.

---
 drivers/gpu/drm/mediatek/mtk_hdmi_ddc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_hdmi_ddc.c +1 -3
index 33c9e1bdb114b8..ca4caf924deb81 100644
@@ -310,10 +310,8 @@ static int mtk_hdmi_ddc_probe(struct platform_device *pdev)
 	ddc->adap.dev.parent = &pdev->dev;
 
 	ret = i2c_add_adapter(&ddc->adap);
-	if (ret < 0) {
-		dev_err(dev, "failed to add bus to i2c core\n");
+	if (ret < 0)
 		goto err_clk_disable;
-	}
 
 	platform_set_drvdata(pdev, ddc);
 
Signature · 1 line
2.8.1
#3 lore raw

PATCH 3/5 gpu: drm: msm: hdmi: hdmi_i2c: don't print error when adding adapter fails

In reply to Wolfram Sang

The core will do this for us now.

---
 drivers/gpu/drm/msm/hdmi/hdmi_i2c.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/msm/hdmi/hdmi_i2c.c +1 -4
index de9007e72f4e85..73e20219d431a7 100644
@@ -243,7 +243,6 @@ void msm_hdmi_i2c_destroy(struct i2c_adapter *i2c)
 
 struct i2c_adapter *msm_hdmi_i2c_init(struct hdmi *hdmi)
 {
-	struct drm_device *dev = hdmi->dev;
 	struct hdmi_i2c_adapter *hdmi_i2c;
 	struct i2c_adapter *i2c = NULL;
 	int ret;
@@ -267,10 +266,8 @@ struct i2c_adapter *msm_hdmi_i2c_init(struct hdmi *hdmi)
 	i2c->algo = &msm_hdmi_i2c_algorithm;
 
 	ret = i2c_add_adapter(i2c);
-	if (ret) {
-		dev_err(dev->dev, "failed to register hdmi i2c: %d\n", ret);
+	if (ret)
 		goto fail;
-	}
 
 	return i2c;
 
Signature · 1 line
2.8.1
#4 lore raw

PATCH 4/5 gpu: drm: radeon: radeon_i2c: don't print error when adding adapter fails

In reply to Wolfram Sang

The core will do this for us now.

---
 drivers/gpu/drm/radeon/radeon_i2c.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_i2c.c +2 -6
index 9590bcd321c09a..021aa005623f80 100644
@@ -938,10 +938,8 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev,
 			 "Radeon i2c hw bus %s", name);
 		i2c->adapter.algo = &radeon_i2c_algo;
 		ret = i2c_add_adapter(&i2c->adapter);
-		if (ret) {
-			DRM_ERROR("Failed to register hw i2c %s\n", name);
+		if (ret)
 			goto out_free;
-		}
 	} else if (rec->hw_capable &&
 		   radeon_hw_i2c &&
 		   ASIC_IS_DCE3(rdev)) {
@@ -950,10 +948,8 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev,
 			 "Radeon i2c hw bus %s", name);
 		i2c->adapter.algo = &radeon_atom_i2c_algo;
 		ret = i2c_add_adapter(&i2c->adapter);
-		if (ret) {
-			DRM_ERROR("Failed to register hw i2c %s\n", name);
+		if (ret)
 			goto out_free;
-		}
 	} else {
 		/* set the radeon bit adapter */
 		snprintf(i2c->adapter.name, sizeof(i2c->adapter.name),
Signature · 1 line
2.8.1
#6 lore raw

PATCH 5/5 gpu: drm: rockchip: inno_hdmi: don't print error when adding adapter fails

In reply to Wolfram Sang

The core will do this for us now.

---
 drivers/gpu/drm/rockchip/inno_hdmi.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/rockchip/inno_hdmi.c +0 -1
index 006260de9dbd22..566b5634644f82 100644
@@ -800,7 +800,6 @@ static struct i2c_adapter *inno_hdmi_i2c_adapter(struct inno_hdmi *hdmi)
 
 	ret = i2c_add_adapter(adap);
 	if (ret) {
-		dev_warn(hdmi->dev, "cannot add %s I2C adapter\n", adap->name);
 		devm_kfree(hdmi->dev, i2c);
 		return ERR_PTR(ret);
 	}
Signature · 1 line
2.8.1
#5 lore raw

Re: [PATCH 4/5] gpu: drm: radeon: radeon_i2c: don't print error when adding adapter fails

In reply to Wolfram Sang
Quoted 3 lines · Wolfram Sang

The core will do this for us now.

Applied patches 1, 5.

Thanks,

Alex

Quoted 35 lines
---
 drivers/gpu/drm/radeon/radeon_i2c.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_i2c.c +2 -7
index 9590bcd321c09a..021aa005623f80 100644
@@ -938,10 +938,8 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev,
                         "Radeon i2c hw bus %s", name);
                i2c->adapter.algo = &radeon_i2c_algo;
                ret = i2c_add_adapter(&i2c->adapter);
-               if (ret) {
-                       DRM_ERROR("Failed to register hw i2c %s\n", name);
+               if (ret)
                        goto out_free;
-               }
        } else if (rec->hw_capable &&
                   radeon_hw_i2c &&
                   ASIC_IS_DCE3(rdev)) {
@@ -950,10 +948,8 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev,
                         "Radeon i2c hw bus %s", name);
                i2c->adapter.algo = &radeon_atom_i2c_algo;
                ret = i2c_add_adapter(&i2c->adapter);
-               if (ret) {
-                       DRM_ERROR("Failed to register hw i2c %s\n", name);
+               if (ret)
                        goto out_free;
-               }
        } else {
                /* set the radeon bit adapter */
                snprintf(i2c->adapter.name, sizeof(i2c->adapter.name),
--

2.8.1

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel