Re: [PATCH 22/24] drm/bridge: remove the .of_node member

2018-04-30 Thread Peter Rosin
On 2018-04-28 10:09, kbuild test robot wrote:
> Hi Peter,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on v4.17-rc2]
> [also build test ERROR on next-20180426]
> [cannot apply to drm/drm-next robclark/msm-next 
> drm-exynos/exynos-drm/for-next]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Peter-Rosin/device-link-bridge-supplier-drm-device/20180428-135229
> config: arm-allmodconfig (attached as .config)
> compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=arm 
> 
> All errors (new ones prefixed by >>):
> 
>drivers/gpu//drm/rockchip/rockchip_lvds.c: In function 
> 'rockchip_lvds_bind':
>>> drivers/gpu//drm/rockchip/rockchip_lvds.c:381:24: error: 'struct 
>>> drm_bridge' has no member named 'of_node'
>   remote = lvds->bridge->of_node;
>^~
> 
> vim +381 drivers/gpu//drm/rockchip/rockchip_lvds.c

Ugh.

So, patch 1/24 needs to be amended with this

diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c 
b/drivers/gpu/drm/rockchip/rockchip_lvds.c
index e67f4ea28c0e..3f33034b3f58 100644
--- a/drivers/gpu/drm/rockchip/rockchip_lvds.c
+++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c
@@ -377,8 +377,10 @@ static int rockchip_lvds_bind(struct device *dev, struct 
device *master,
}
if (lvds->panel)
remote = lvds->panel->dev->of_node;
-   else
+   else if (lvds->bridge->of_node)
remote = lvds->bridge->of_node;
+   else
+   remote = lvds->bridge->owner->of_node;
if (of_property_read_string(dev->of_node, "rockchip,output", &name))
/* default set it as output rgb */
lvds->output = DISPLAY_OUTPUT_RGB;


and patch 22/24 with this

diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c 
b/drivers/gpu/drm/rockchip/rockchip_lvds.c
index 3f33034b3f58..8c82fa647536 100644
--- a/drivers/gpu/drm/rockchip/rockchip_lvds.c
+++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c
@@ -377,8 +377,6 @@ static int rockchip_lvds_bind(struct device *dev, struct 
device *master,
}
if (lvds->panel)
remote = lvds->panel->dev->of_node;
-   else if (lvds->bridge->of_node)
-   remote = lvds->bridge->of_node;
else
remote = lvds->bridge->owner->of_node;
if (of_property_read_string(dev->of_node, "rockchip,output", &name))


But that is of course just a stop-gap. The real fix is to adapt to the
"drm: bridge: Add support for static image formats​" series from Jacopo.
But that's orthogonal.

Cheers,
Peter


Re: [PATCH 22/24] drm/bridge: remove the .of_node member

2018-04-28 Thread kbuild test robot
Hi Peter,

I love your patch! Yet something to improve:

[auto build test ERROR on v4.17-rc2]
[also build test ERROR on next-20180426]
[cannot apply to drm/drm-next robclark/msm-next drm-exynos/exynos-drm/for-next]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Peter-Rosin/device-link-bridge-supplier-drm-device/20180428-135229
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm 

All errors (new ones prefixed by >>):

   drivers/gpu//drm/rockchip/rockchip_lvds.c: In function 'rockchip_lvds_bind':
>> drivers/gpu//drm/rockchip/rockchip_lvds.c:381:24: error: 'struct drm_bridge' 
>> has no member named 'of_node'
  remote = lvds->bridge->of_node;
   ^~

vim +381 drivers/gpu//drm/rockchip/rockchip_lvds.c

34cc0aa25 Sandy Huang 2017-09-02  340  
34cc0aa25 Sandy Huang 2017-09-02  341  static int rockchip_lvds_bind(struct 
device *dev, struct device *master,
34cc0aa25 Sandy Huang 2017-09-02  342 void *data)
34cc0aa25 Sandy Huang 2017-09-02  343  {
34cc0aa25 Sandy Huang 2017-09-02  344   struct rockchip_lvds *lvds = 
dev_get_drvdata(dev);
34cc0aa25 Sandy Huang 2017-09-02  345   struct drm_device *drm_dev = data;
34cc0aa25 Sandy Huang 2017-09-02  346   struct drm_encoder *encoder;
34cc0aa25 Sandy Huang 2017-09-02  347   struct drm_connector *connector;
34cc0aa25 Sandy Huang 2017-09-02  348   struct device_node *remote = NULL;
34cc0aa25 Sandy Huang 2017-09-02  349   struct device_node  *port, *endpoint;
6bf2e0324 Sean Paul   2017-09-20  350   int ret = 0, child_count = 0;
34cc0aa25 Sandy Huang 2017-09-02  351   const char *name;
34cc0aa25 Sandy Huang 2017-09-02  352   u32 endpoint_id;
34cc0aa25 Sandy Huang 2017-09-02  353  
34cc0aa25 Sandy Huang 2017-09-02  354   lvds->drm_dev = drm_dev;
34cc0aa25 Sandy Huang 2017-09-02  355   port = 
of_graph_get_port_by_id(dev->of_node, 1);
34cc0aa25 Sandy Huang 2017-09-02  356   if (!port) {
34cc0aa25 Sandy Huang 2017-09-02  357   DRM_DEV_ERROR(dev,
34cc0aa25 Sandy Huang 2017-09-02  358 "can't found port 
point, please init lvds panel port!\n");
34cc0aa25 Sandy Huang 2017-09-02  359   return -EINVAL;
34cc0aa25 Sandy Huang 2017-09-02  360   }
34cc0aa25 Sandy Huang 2017-09-02  361   for_each_child_of_node(port, endpoint) {
6bf2e0324 Sean Paul   2017-09-20  362   child_count++;
34cc0aa25 Sandy Huang 2017-09-02  363   of_property_read_u32(endpoint, 
"reg", &endpoint_id);
34cc0aa25 Sandy Huang 2017-09-02  364   ret = 
drm_of_find_panel_or_bridge(dev->of_node, 1, endpoint_id,
34cc0aa25 Sandy Huang 2017-09-02  365   
  &lvds->panel, &lvds->bridge);
34cc0aa25 Sandy Huang 2017-09-02  366   if (!ret)
34cc0aa25 Sandy Huang 2017-09-02  367   break;
34cc0aa25 Sandy Huang 2017-09-02  368   }
6bf2e0324 Sean Paul   2017-09-20  369   if (!child_count) {
6bf2e0324 Sean Paul   2017-09-20  370   DRM_DEV_ERROR(dev, "lvds port 
does not have any children\n");
6bf2e0324 Sean Paul   2017-09-20  371   ret = -EINVAL;
6bf2e0324 Sean Paul   2017-09-20  372   goto err_put_port;
6bf2e0324 Sean Paul   2017-09-20  373   } else if (ret) {
34cc0aa25 Sandy Huang 2017-09-02  374   DRM_DEV_ERROR(dev, "failed to 
find panel and bridge node\n");
34cc0aa25 Sandy Huang 2017-09-02  375   ret = -EPROBE_DEFER;
34cc0aa25 Sandy Huang 2017-09-02  376   goto err_put_port;
34cc0aa25 Sandy Huang 2017-09-02  377   }
34cc0aa25 Sandy Huang 2017-09-02  378   if (lvds->panel)
34cc0aa25 Sandy Huang 2017-09-02  379   remote = 
lvds->panel->dev->of_node;
34cc0aa25 Sandy Huang 2017-09-02  380   else
34cc0aa25 Sandy Huang 2017-09-02 @381   remote = lvds->bridge->of_node;
34cc0aa25 Sandy Huang 2017-09-02  382   if 
(of_property_read_string(dev->of_node, "rockchip,output", &name))
34cc0aa25 Sandy Huang 2017-09-02  383   /* default set it as output rgb 
*/
34cc0aa25 Sandy Huang 2017-09-02  384   lvds->output = 
DISPLAY_OUTPUT_RGB;
34cc0aa25 Sandy Huang 2017-09-02  385   else
34cc0aa25 Sandy Huang 2017-09-02  386   lvds->output = 
lvds_name_to_output(name);
34cc0aa25 Sandy Huang 2017-09-02  387  
34cc0aa25 Sandy Huang 2017-09-02  388   if (lvds->output < 0) {
34cc0aa25 Sandy Huang 2017-09-02  389   DRM_DEV_ERROR(dev, "invalid 
output type [%s]\n", name);
34cc0aa25 Sandy Huang 2017-09-02  390   ret = lvds->output;
34cc0aa25 Sandy Huang 2017-09-02  391   goto err_put_remote;
34cc0aa25 Sandy Huang 2017-09-02  392   }
34cc0aa25 Sandy Huang 2017-09-02  393  
34cc0aa25 Sandy Huan

[PATCH 22/24] drm/bridge: remove the .of_node member

2018-04-26 Thread Peter Rosin
It is unused.

Signed-off-by: Peter Rosin 
---
 drivers/gpu/drm/drm_bridge.c | 3 +--
 include/drm/drm_bridge.h | 4 
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index 67147673fdeb..9f023bd84d56 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -365,8 +365,7 @@ struct drm_bridge *of_drm_find_bridge(struct device_node 
*np)
mutex_lock(&bridge_lock);
 
list_for_each_entry(bridge, &bridge_list, list) {
-   if ((bridge->owner && bridge->owner->of_node == np) ||
-   bridge->of_node == np) {
+   if (bridge->owner->of_node == np) {
mutex_unlock(&bridge_lock);
return bridge;
}
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index c28a75ad0ae2..3bc659f3e7d2 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -258,7 +258,6 @@ struct drm_bridge_timings {
  * @dev: DRM device this bridge belongs to
  * @encoder: encoder to which this bridge is connected
  * @next: the next bridge in the encoder chain
- * @of_node: device node pointer to the bridge
  * @list: to keep track of all added bridges
  * @timings: the timing specification for the bridge, if any (may
  * be NULL)
@@ -270,9 +269,6 @@ struct drm_bridge {
struct drm_device *dev;
struct drm_encoder *encoder;
struct drm_bridge *next;
-#ifdef CONFIG_OF
-   struct device_node *of_node;
-#endif
struct list_head list;
const struct drm_bridge_timings *timings;
 
-- 
2.11.0