Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: gpmi-nand: fix error return from gpmi_get_clks()

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

authored by

Michał Mirosław and committed by
David Woodhouse
d1cb556c cf3b55a9

+8 -4
+8 -4
drivers/mtd/nand/gpmi-nand/gpmi-nand.c
··· 473 473 struct resources *r = &this->resources; 474 474 char **extra_clks = NULL; 475 475 struct clk *clk; 476 - int i; 476 + int err, i; 477 477 478 478 /* The main clock is stored in the first. */ 479 479 r->clock[0] = clk_get(this->dev, "gpmi_io"); 480 - if (IS_ERR(r->clock[0])) 480 + if (IS_ERR(r->clock[0])) { 481 + err = PTR_ERR(r->clock[0]); 481 482 goto err_clock; 483 + } 482 484 483 485 /* Get extra clocks */ 484 486 if (GPMI_IS_MX6Q(this)) ··· 493 491 break; 494 492 495 493 clk = clk_get(this->dev, extra_clks[i - 1]); 496 - if (IS_ERR(clk)) 494 + if (IS_ERR(clk)) { 495 + err = PTR_ERR(clk); 497 496 goto err_clock; 497 + } 498 498 499 499 r->clock[i] = clk; 500 500 } ··· 515 511 err_clock: 516 512 dev_dbg(this->dev, "failed in finding the clocks.\n"); 517 513 gpmi_put_clks(this); 518 - return -ENOMEM; 514 + return err; 519 515 } 520 516 521 517 static int acquire_resources(struct gpmi_nand_data *this)