pinctrl-mvebu.c (4ba24fef3eb3b142197135223b90ced2f319cd53) | pinctrl-mvebu.c (323de9efdf3e75d1dfb48003a52e59d6d9d4c7a5) |
---|---|
1/* 2 * Marvell MVEBU pinctrl core driver 3 * 4 * Authors: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> 5 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by --- 692 unchanged lines hidden (view full) --- 701 702 ret = mvebu_pinctrl_build_functions(pdev, pctl); 703 if (ret) { 704 dev_err(&pdev->dev, "unable to build functions\n"); 705 return ret; 706 } 707 708 pctl->pctldev = pinctrl_register(&pctl->desc, &pdev->dev, pctl); | 1/* 2 * Marvell MVEBU pinctrl core driver 3 * 4 * Authors: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> 5 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by --- 692 unchanged lines hidden (view full) --- 701 702 ret = mvebu_pinctrl_build_functions(pdev, pctl); 703 if (ret) { 704 dev_err(&pdev->dev, "unable to build functions\n"); 705 return ret; 706 } 707 708 pctl->pctldev = pinctrl_register(&pctl->desc, &pdev->dev, pctl); |
709 if (!pctl->pctldev) { | 709 if (IS_ERR(pctl->pctldev)) { |
710 dev_err(&pdev->dev, "unable to register pinctrl driver\n"); | 710 dev_err(&pdev->dev, "unable to register pinctrl driver\n"); |
711 return -EINVAL; | 711 return PTR_ERR(pctl->pctldev); |
712 } 713 714 dev_info(&pdev->dev, "registered pinctrl driver\n"); 715 716 /* register gpio ranges */ 717 for (n = 0; n < soc->ngpioranges; n++) 718 pinctrl_add_gpio_range(pctl->pctldev, &soc->gpioranges[n]); 719 720 return 0; 721} 722 723int mvebu_pinctrl_remove(struct platform_device *pdev) 724{ 725 struct mvebu_pinctrl *pctl = platform_get_drvdata(pdev); 726 pinctrl_unregister(pctl->pctldev); 727 return 0; 728} | 712 } 713 714 dev_info(&pdev->dev, "registered pinctrl driver\n"); 715 716 /* register gpio ranges */ 717 for (n = 0; n < soc->ngpioranges; n++) 718 pinctrl_add_gpio_range(pctl->pctldev, &soc->gpioranges[n]); 719 720 return 0; 721} 722 723int mvebu_pinctrl_remove(struct platform_device *pdev) 724{ 725 struct mvebu_pinctrl *pctl = platform_get_drvdata(pdev); 726 pinctrl_unregister(pctl->pctldev); 727 return 0; 728} |