Convert the argument to the newer fwnode_handle instead a device tree node. Fortunately, there are no users for now. So this is an easy change.
Unified · Split
| @@ -541,9 +541,9 @@ static const struct irq_domain_ops regmap_domain_ops = { · 540 unmodified lines | ||
| 541 | 541 | }; |
| 542 | 542 | |
| 543 | 543 | /** |
| 544 | − * regmap_add_irq_chip_np() - Use standard regmap IRQ controller handling | |
| 544 | + * regmap_add_irq_chip_fwnode() - Use standard regmap IRQ controller handling | |
| 545 | 545 | * |
| 546 | − * @np: The device_node where the IRQ domain should be added to. | |
| 546 | + * @fwnode: The firmware node where the IRQ domain should be added to. | |
| 547 | 547 | * @map: The regmap for the device. |
| 548 | 548 | * @irq: The IRQ the device uses to signal interrupts. |
| 549 | 549 | * @irq_flags: The IRQF_ flags to use for the primary interrupt. |
| @@ -557,10 +557,11 @@ static const struct irq_domain_ops regmap_domain_ops = { · 7 unmodified lines | ||
| 557 | 557 | * register cache. The chip driver is responsible for restoring the |
| 558 | 558 | * register values used by the IRQ controller over suspend and resume. |
| 559 | 559 | */ |
| 560 | −int regmap_add_irq_chip_np(struct device_node *np, struct regmap *map, int irq, | |
| 561 | − int irq_flags, int irq_base, | |
| 562 | − const struct regmap_irq_chip *chip, | |
| 563 | − struct regmap_irq_chip_data **data) | |
| 560 | +int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, | |
| 561 | + struct regmap *map, int irq, | |
| 562 | + int irq_flags, int irq_base, | |
| 563 | + const struct regmap_irq_chip *chip, | |
| 564 | + struct regmap_irq_chip_data **data) | |
| 564 | 565 | { |
| 565 | 566 | struct regmap_irq_chip_data *d; |
| 566 | 567 | int i; |
| @@ -771,10 +772,12 @@ int regmap_add_irq_chip_np(struct device_node *np, struct regmap *map, int irq, · 204 unmodified lines | ||
| 771 | 772 | } |
| 772 | 773 | |
| 773 | 774 | if (irq_base) |
| 774 | − d->domain = irq_domain_add_legacy(np, chip->num_irqs, irq_base, | |
| 775 | + d->domain = irq_domain_add_legacy(to_of_node(fwnode), | |
| 776 | + chip->num_irqs, irq_base, | |
| 775 | 777 | 0, ®map_domain_ops, d); |
| 776 | 778 | else |
| 777 | − d->domain = irq_domain_add_linear(np, chip->num_irqs, | |
| 779 | + d->domain = irq_domain_add_linear(to_of_node(fwnode), | |
| 780 | + chip->num_irqs, | |
| 778 | 781 | ®map_domain_ops, d); |
| 779 | 782 | if (!d->domain) { |
| 780 | 783 | dev_err(map->dev, "Failed to create IRQ domain\n"); |
| @@ -808,7 +811,7 @@ err_alloc: · 27 unmodified lines | ||
| 808 | 811 | kfree(d); |
| 809 | 812 | return ret; |
| 810 | 813 | } |
| 811 | −EXPORT_SYMBOL_GPL(regmap_add_irq_chip_np); | |
| 814 | +EXPORT_SYMBOL_GPL(regmap_add_irq_chip_fwnode); | |
| 812 | 815 | |
| 813 | 816 | /** |
| 814 | 817 | * regmap_add_irq_chip() - Use standard regmap IRQ controller handling |
| @@ -822,15 +825,15 @@ EXPORT_SYMBOL_GPL(regmap_add_irq_chip_np); · 7 unmodified lines | ||
| 822 | 825 | * |
| 823 | 826 | * Returns 0 on success or an errno on failure. |
| 824 | 827 | * |
| 825 | − * This is the same as regmap_add_irq_chip_np, except that the device | |
| 828 | + * This is the same as regmap_add_irq_chip_fwnode, except that the firmware | |
| 826 | 829 | * node of the regmap is used. |
| 827 | 830 | */ |
| 828 | 831 | int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, |
| 829 | 832 | int irq_base, const struct regmap_irq_chip *chip, |
| 830 | 833 | struct regmap_irq_chip_data **data) |
| 831 | 834 | { |
| 832 | − return regmap_add_irq_chip_np(map->dev->of_node, map, irq, irq_flags, | |
| 833 | − irq_base, chip, data); | |
| 835 | + return regmap_add_irq_chip_fwnode(dev_fwnode(map->dev), map, irq, | |
| 836 | + irq_flags, irq_base, chip, data); | |
| 834 | 837 | } |
| 835 | 838 | EXPORT_SYMBOL_GPL(regmap_add_irq_chip); |
| 836 | 839 | |
| @@ -899,10 +902,10 @@ static int devm_regmap_irq_chip_match(struct device *dev, void *res, void *data) · 62 unmodified lines | ||
| 899 | 902 | } |
| 900 | 903 | |
| 901 | 904 | /** |
| 902 | − * devm_regmap_add_irq_chip_np() - Resource manager regmap_add_irq_chip_np() | |
| 905 | + * devm_regmap_add_irq_chip_fwnode() - Resource managed regmap_add_irq_chip_fwnode() | |
| 903 | 906 | * |
| 904 | 907 | * @dev: The device pointer on which irq_chip belongs to. |
| 905 | − * @np: The device_node where the IRQ domain should be added to. | |
| 908 | + * @fwnode: The firmware node where the IRQ domain should be added to. | |
| 906 | 909 | * @map: The regmap for the device. |
| 907 | 910 | * @irq: The IRQ the device uses to signal interrupts |
| 908 | 911 | * @irq_flags: The IRQF_ flags to use for the primary interrupt. |
| @@ -915,11 +918,12 @@ static int devm_regmap_irq_chip_match(struct device *dev, void *res, void *data) · 6 unmodified lines | ||
| 915 | 918 | * The ®map_irq_chip_data will be automatically released when the device is |
| 916 | 919 | * unbound. |
| 917 | 920 | */ |
| 918 | −int devm_regmap_add_irq_chip_np(struct device *dev, struct device_node *np, | |
| 919 | − struct regmap *map, int irq, int irq_flags, | |
| 920 | − int irq_base, | |
| 921 | − const struct regmap_irq_chip *chip, | |
| 922 | − struct regmap_irq_chip_data **data) | |
| 921 | +int devm_regmap_add_irq_chip_fwnode(struct device *dev, | |
| 922 | + struct fwnode_handle *fwnode, | |
| 923 | + struct regmap *map, int irq, | |
| 924 | + int irq_flags, int irq_base, | |
| 925 | + const struct regmap_irq_chip *chip, | |
| 926 | + struct regmap_irq_chip_data **data) | |
| 923 | 927 | { |
| 924 | 928 | struct regmap_irq_chip_data **ptr, *d; |
| 925 | 929 | int ret; |
| @@ -929,8 +933,8 @@ int devm_regmap_add_irq_chip_np(struct device *dev, struct device_node *np, · 3 unmodified lines | ||
| 929 | 933 | if (!ptr) |
| 930 | 934 | return -ENOMEM; |
| 931 | 935 | |
| 932 | − ret = regmap_add_irq_chip_np(np, map, irq, irq_flags, irq_base, | |
| 933 | − chip, &d); | |
| 936 | + ret = regmap_add_irq_chip_fwnode(fwnode, map, irq, irq_flags, irq_base, | |
| 937 | + chip, &d); | |
| 934 | 938 | if (ret < 0) { |
| 935 | 939 | devres_free(ptr); |
| 936 | 940 | return ret; |
| @@ -941,7 +945,7 @@ int devm_regmap_add_irq_chip_np(struct device *dev, struct device_node *np, · 4 unmodified lines | ||
| 941 | 945 | *data = d; |
| 942 | 946 | return 0; |
| 943 | 947 | } |
| 944 | −EXPORT_SYMBOL_GPL(devm_regmap_add_irq_chip_np); | |
| 948 | +EXPORT_SYMBOL_GPL(devm_regmap_add_irq_chip_fwnode); | |
| 945 | 949 | |
| 946 | 950 | /** |
| 947 | 951 | * devm_regmap_add_irq_chip() - Resource manager regmap_add_irq_chip() |
| @@ -964,8 +968,9 @@ int devm_regmap_add_irq_chip(struct device *dev, struct regmap *map, int irq, · 16 unmodified lines | ||
| 964 | 968 | const struct regmap_irq_chip *chip, |
| 965 | 969 | struct regmap_irq_chip_data **data) |
| 966 | 970 | { |
| 967 | − return devm_regmap_add_irq_chip_np(dev, map->dev->of_node, map, irq, | |
| 968 | − irq_flags, irq_base, chip, data); | |
| 971 | + return devm_regmap_add_irq_chip_fwnode(dev, dev_fwnode(map->dev), map, | |
| 972 | + irq, irq_flags, irq_base, chip, | |
| 973 | + data); | |
| 969 | 974 | } |
| 970 | 975 | EXPORT_SYMBOL_GPL(devm_regmap_add_irq_chip); |
| 971 | 976 | |
| @@ -18,6 +18,7 @@ · 17 unmodified lines | ||
| 18 | 18 | #include <linux/bug.h> |
| 19 | 19 | #include <linux/lockdep.h> |
| 20 | 20 | #include <linux/iopoll.h> |
| 21 | +#include <linux/fwnode.h> | |
| 21 | 22 | |
| 22 | 23 | struct module; |
| 23 | 24 | struct clk; |
| @@ -1311,21 +1312,23 @@ struct regmap_irq_chip_data; · 1287 unmodified lines | ||
| 1311 | 1312 | int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, |
| 1312 | 1313 | int irq_base, const struct regmap_irq_chip *chip, |
| 1313 | 1314 | struct regmap_irq_chip_data **data); |
| 1314 | −int regmap_add_irq_chip_np(struct device_node *np, struct regmap *map, int irq, | |
| 1315 | − int irq_flags, int irq_base, | |
| 1316 | − const struct regmap_irq_chip *chip, | |
| 1317 | − struct regmap_irq_chip_data **data); | |
| 1315 | +int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, | |
| 1316 | + struct regmap *map, int irq, | |
| 1317 | + int irq_flags, int irq_base, | |
| 1318 | + const struct regmap_irq_chip *chip, | |
| 1319 | + struct regmap_irq_chip_data **data); | |
| 1318 | 1320 | void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); |
| 1319 | 1321 | |
| 1320 | 1322 | int devm_regmap_add_irq_chip(struct device *dev, struct regmap *map, int irq, |
| 1321 | 1323 | int irq_flags, int irq_base, |
| 1322 | 1324 | const struct regmap_irq_chip *chip, |
| 1323 | 1325 | struct regmap_irq_chip_data **data); |
| 1324 | −int devm_regmap_add_irq_chip_np(struct device *dev, struct device_node *np, | |
| 1325 | − struct regmap *map, int irq, int irq_flags, | |
| 1326 | − int irq_base, | |
| 1327 | − const struct regmap_irq_chip *chip, | |
| 1328 | − struct regmap_irq_chip_data **data); | |
| 1326 | +int devm_regmap_add_irq_chip_fwnode(struct device *dev, | |
| 1327 | + struct fwnode_handle *fwnode, | |
| 1328 | + struct regmap *map, int irq, | |
| 1329 | + int irq_flags, int irq_base, | |
| 1330 | + const struct regmap_irq_chip *chip, | |
| 1331 | + struct regmap_irq_chip_data **data); | |
| 1329 | 1332 | void devm_regmap_del_irq_chip(struct device *dev, int irq, |
| 1330 | 1333 | struct regmap_irq_chip_data *data); |
| 1331 | 1334 | |