Skip to content

Commit 91bfcc7

Browse files
raagjadavandy-shev
authored andcommitted
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>
1 parent d795fb9 commit 91bfcc7

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)