@@ -3033,8 +3033,8 @@ static int rockchip_pinctrl_parse_dt(struct platform_device *pdev,
struct rockchip_pinctrl *info)
{
struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
- struct device_node *child;
+ struct fwnode_handle *fwnode = dev_fwnode(dev);
+ struct device_node *np = to_of_node(fwnode), *child;
int ret;
int i;
@@ -3129,7 +3129,8 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data(
struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct device_node *node = dev->of_node;
+ struct fwnode_handle *fwnode = dev_fwnode(dev);
+ struct device_node *node = to_of_node(fwnode);
const struct of_device_id *match;
struct rockchip_pin_ctrl *ctrl;
struct rockchip_pin_bank *bank;
@@ -3291,15 +3292,16 @@ static SIMPLE_DEV_PM_OPS(rockchip_pinctrl_dev_pm_ops, rockchip_pinctrl_suspend,
static int rockchip_pinctrl_probe(struct platform_device *pdev)
{
- struct rockchip_pinctrl *info;
struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node, *node;
+ struct fwnode_handle *fwnode = dev_fwnode(dev);
+ struct device_node *np = to_of_node(fwnode), *node;
+ struct rockchip_pinctrl *info;
struct rockchip_pin_ctrl *ctrl;
struct resource *res;
void __iomem *base;
int ret;
- if (!dev->of_node)
+ if (!is_of_node(fwnode))
return dev_err_probe(dev, -ENODEV, "device tree node not found\n");
ret = of_platform_populate(np, NULL, NULL, dev);
Switch the pinctrl driver to use fwnode instead of the of_node. Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com> --- drivers/pinctrl/pinctrl-rockchip.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)