Skip to content

Commit 4b5bf35

Browse files
committed
pinctrl: tangier: use devm_kmemdup_array()
JIRA: https://issues.redhat.com/browse/RHEL-113190 commit 91bfcc7 Author: Raag Jadav <raag.jadav@intel.com> Date: Wed Feb 12 11:55:09 2025 +0530 pinctrl: tangier: use devm_kmemdup_array() Convert to use devm_kmemdup_array() and while at it, use source size instead of destination. Signed-off-by: Raag Jadav <raag.jadav@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Steve Best <sbest@redhat.com>
1 parent 11a7214 commit 4b5bf35

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/pinctrl/intel/pinctrl-tangier.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ static int tng_pinctrl_probe(struct platform_device *pdev,
524524
struct device *dev = &pdev->dev;
525525
struct tng_family *families;
526526
struct tng_pinctrl *tp;
527-
size_t families_len;
528527
void __iomem *regs;
529528
unsigned int i;
530529

@@ -543,8 +542,8 @@ static int tng_pinctrl_probe(struct platform_device *pdev,
543542
* Make a copy of the families which we can use to hold pointers
544543
* to the registers.
545544
*/
546-
families_len = size_mul(sizeof(*families), tp->nfamilies);
547-
families = devm_kmemdup(dev, tp->families, families_len, GFP_KERNEL);
545+
families = devm_kmemdup_array(dev, tp->families, tp->nfamilies,
546+
sizeof(*tp->families), GFP_KERNEL);
548547
if (!families)
549548
return -ENOMEM;
550549

0 commit comments

Comments
 (0)