@@ -453,10 +453,9 @@ static int rk3288_lvds_probe(struct platform_device *pdev,
453453 return PTR_ERR (lvds -> regs );
454454
455455 lvds -> pclk = devm_clk_get_prepared (lvds -> dev , "pclk_lvds" );
456- if (IS_ERR (lvds -> pclk )) {
457- DRM_DEV_ERROR (lvds -> dev , "could not get or prepare pclk_lvds\n" );
458- return PTR_ERR (lvds -> pclk );
459- }
456+ if (IS_ERR (lvds -> pclk ))
457+ return dev_err_probe (lvds -> dev , PTR_ERR (lvds -> pclk ),
458+ "could not get or prepare pclk_lvds\n" );
460459
461460 lvds -> pins = devm_kzalloc (lvds -> dev , sizeof (* lvds -> pins ),
462461 GFP_KERNEL );
@@ -465,14 +464,14 @@ static int rk3288_lvds_probe(struct platform_device *pdev,
465464
466465 lvds -> pins -> p = devm_pinctrl_get (lvds -> dev );
467466 if (IS_ERR (lvds -> pins -> p )) {
468- DRM_DEV_ERROR (lvds -> dev , "no pinctrl handle\n" );
467+ dev_err (lvds -> dev , "no pinctrl handle\n" );
469468 devm_kfree (lvds -> dev , lvds -> pins );
470469 lvds -> pins = NULL ;
471470 } else {
472471 lvds -> pins -> default_state =
473472 pinctrl_lookup_state (lvds -> pins -> p , "lcdc" );
474473 if (IS_ERR (lvds -> pins -> default_state )) {
475- DRM_DEV_ERROR (lvds -> dev , "no default pinctrl state\n" );
474+ dev_err (lvds -> dev , "no default pinctrl state\n" );
476475 devm_kfree (lvds -> dev , lvds -> pins );
477476 lvds -> pins = NULL ;
478477 }
@@ -547,11 +546,10 @@ static int rockchip_lvds_bind(struct device *dev, struct device *master,
547546
548547 lvds -> drm_dev = drm_dev ;
549548 port = of_graph_get_port_by_id (dev -> of_node , 1 );
550- if (!port ) {
551- DRM_DEV_ERROR (dev ,
552- "can't found port point, please init lvds panel port!\n" );
553- return - EINVAL ;
554- }
549+ if (!port )
550+ return dev_err_probe (dev , - EINVAL ,
551+ "can't found port point, please init lvds panel port!\n" );
552+
555553 for_each_child_of_node (port , endpoint ) {
556554 child_count ++ ;
557555 of_property_read_u32 (endpoint , "reg" , & endpoint_id );
@@ -563,8 +561,7 @@ static int rockchip_lvds_bind(struct device *dev, struct device *master,
563561 }
564562 }
565563 if (!child_count ) {
566- DRM_DEV_ERROR (dev , "lvds port does not have any children\n" );
567- ret = - EINVAL ;
564+ ret = dev_err_probe (dev , - EINVAL , "lvds port does not have any children\n" );
568565 goto err_put_port ;
569566 } else if (ret ) {
570567 dev_err_probe (dev , ret , "failed to find panel and bridge node\n" );
@@ -581,8 +578,7 @@ static int rockchip_lvds_bind(struct device *dev, struct device *master,
581578 lvds -> output = rockchip_lvds_name_to_output (name );
582579
583580 if (lvds -> output < 0 ) {
584- DRM_DEV_ERROR (dev , "invalid output type [%s]\n" , name );
585- ret = lvds -> output ;
581+ ret = dev_err_probe (dev , lvds -> output , "invalid output type [%s]\n" , name );
586582 goto err_put_remote ;
587583 }
588584
@@ -593,8 +589,8 @@ static int rockchip_lvds_bind(struct device *dev, struct device *master,
593589 lvds -> format = rockchip_lvds_name_to_format (name );
594590
595591 if (lvds -> format < 0 ) {
596- DRM_DEV_ERROR (dev , "invalid data-mapping format [%s]\n" , name );
597- ret = lvds -> format ;
592+ ret = dev_err_probe (dev , lvds -> format ,
593+ "invalid data-mapping format [%s]\n" , name ) ;
598594 goto err_put_remote ;
599595 }
600596
@@ -604,8 +600,8 @@ static int rockchip_lvds_bind(struct device *dev, struct device *master,
604600
605601 ret = drm_simple_encoder_init (drm_dev , encoder , DRM_MODE_ENCODER_LVDS );
606602 if (ret < 0 ) {
607- DRM_DEV_ERROR (drm_dev -> dev ,
608- "failed to initialize encoder: %d\n" , ret );
603+ drm_err (drm_dev ,
604+ "failed to initialize encoder: %d\n" , ret );
609605 goto err_put_remote ;
610606 }
611607
@@ -618,8 +614,8 @@ static int rockchip_lvds_bind(struct device *dev, struct device *master,
618614 & rockchip_lvds_connector_funcs ,
619615 DRM_MODE_CONNECTOR_LVDS );
620616 if (ret < 0 ) {
621- DRM_DEV_ERROR (drm_dev -> dev ,
622- "failed to initialize connector: %d\n" , ret );
617+ drm_err (drm_dev ,
618+ "failed to initialize connector: %d\n" , ret );
623619 goto err_free_encoder ;
624620 }
625621
@@ -633,18 +629,17 @@ static int rockchip_lvds_bind(struct device *dev, struct device *master,
633629
634630 connector = drm_bridge_connector_init (lvds -> drm_dev , encoder );
635631 if (IS_ERR (connector )) {
636- DRM_DEV_ERROR (drm_dev -> dev ,
637- "failed to initialize bridge connector: %pe\n" ,
638- connector );
632+ drm_err (drm_dev ,
633+ "failed to initialize bridge connector: %pe\n" ,
634+ connector );
639635 ret = PTR_ERR (connector );
640636 goto err_free_encoder ;
641637 }
642638 }
643639
644640 ret = drm_connector_attach_encoder (connector , encoder );
645641 if (ret < 0 ) {
646- DRM_DEV_ERROR (drm_dev -> dev ,
647- "failed to attach encoder: %d\n" , ret );
642+ drm_err (drm_dev , "failed to attach encoder: %d\n" , ret );
648643 goto err_free_connector ;
649644 }
650645
@@ -706,24 +701,20 @@ static int rockchip_lvds_probe(struct platform_device *pdev)
706701
707702 lvds -> grf = syscon_regmap_lookup_by_phandle (dev -> of_node ,
708703 "rockchip,grf" );
709- if (IS_ERR (lvds -> grf )) {
710- DRM_DEV_ERROR (dev , "missing rockchip,grf property\n" );
711- return PTR_ERR (lvds -> grf );
712- }
704+ if (IS_ERR (lvds -> grf ))
705+ return dev_err_probe (dev , PTR_ERR (lvds -> grf ), "missing rockchip,grf property\n" );
713706
714707 ret = lvds -> soc_data -> probe (pdev , lvds );
715- if (ret ) {
716- DRM_DEV_ERROR (dev , "Platform initialization failed\n" );
717- return ret ;
718- }
708+ if (ret )
709+ return dev_err_probe (dev , ret , "Platform initialization failed\n" );
719710
720711 dev_set_drvdata (dev , lvds );
721712
722713 ret = component_add (& pdev -> dev , & rockchip_lvds_component_ops );
723714 if (ret < 0 )
724- DRM_DEV_ERROR (dev , "failed to add component\n" );
715+ return dev_err_probe (dev , ret , "failed to add component\n" );
725716
726- return ret ;
717+ return 0 ;
727718}
728719
729720static void rockchip_lvds_remove (struct platform_device * pdev )
0 commit comments