diff mbox

memory: omap-gpmc: use devm_gpiochip_add_data()

Message ID f0603981-2906-d32b-9a67-e0cb98a0835e@ti.com
State New
Headers show

Commit Message

Roger Quadros Aug. 8, 2016, 10:37 a.m. UTC
On 08/08/16 12:31, kbuild test robot wrote:
> Hi Linus,

> 

> [auto build test ERROR on linus/master]

> [also build test ERROR on v4.8-rc1 next-20160805]

> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

> 

> url:    https://github.com/0day-ci/linux/commits/Linus-Walleij/memory-omap-gpmc-use-devm_gpiochip_add_data/20160808-160509

> config: arm-multi_v7_defconfig (attached as .config)

> compiler: arm-linux-gnueabi-gcc (Debian 5.4.0-6) 5.4.0 20160609

> reproduce:

>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross

>         chmod +x ~/bin/make.cross

>         # save the attached .config to linux build tree

>         make.cross ARCH=arm 

> 

> All errors (new ones prefixed by >>):

> 

>    drivers/memory/omap-gpmc.c: In function 'gpmc_gpio_init':

>>> drivers/memory/omap-gpmc.c:2269:31: error: 'gpmv' undeclared (first use in this function)

>      ret = devm_gpiochip_add_data(gpmv->dev, &gpmc->gpio_chip, NULL);

>                                   ^

>    drivers/memory/omap-gpmc.c:2269:31: note: each undeclared identifier is reported only once for each function it appears in

>    drivers/memory/omap-gpmc.c: In function 'gpmc_probe':

>>> drivers/memory/omap-gpmc.c:2378:2: error: implicit declaration of function 'gpmc_gpio_exit' [-Werror=implicit-function-declaration]

>      gpmc_gpio_exit(gpmc);

>      ^

>    cc1: some warnings being treated as errors

> 

> vim +/gpmv +2269 drivers/memory/omap-gpmc.c

> 

>   2263		gpmc->gpio_chip.direction_input = gpmc_gpio_direction_input;

>   2264		gpmc->gpio_chip.direction_output = gpmc_gpio_direction_output;

>   2265		gpmc->gpio_chip.set = gpmc_gpio_set;

>   2266		gpmc->gpio_chip.get = gpmc_gpio_get;

>   2267		gpmc->gpio_chip.base = -1;

>   2268	

>> 2269		ret = devm_gpiochip_add_data(gpmv->dev, &gpmc->gpio_chip, NULL);

>   2270		if (ret < 0) {

>   2271			dev_err(gpmc->dev, "could not register gpio chip: %d\n", ret);

>   2272			return ret;

>   2273		}

>   2274	

>   2275		return 0;

>   2276	}

>   2277	

>   2278	static int gpmc_probe(struct platform_device *pdev)

>   2279	{

>   2280		int rc;

>   2281		u32 l;

>   2282		struct resource *res;

>   2283		struct gpmc_device *gpmc;

>   2284	

>   2285		gpmc = devm_kzalloc(&pdev->dev, sizeof(*gpmc), GFP_KERNEL);

>   2286		if (!gpmc)

>   2287			return -ENOMEM;

>   2288	

>   2289		gpmc->dev = &pdev->dev;

>   2290		platform_set_drvdata(pdev, gpmc);

>   2291	

>   2292		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

>   2293		if (res == NULL)

>   2294			return -ENOENT;

>   2295	

>   2296		phys_base = res->start;

>   2297		mem_size = resource_size(res);

>   2298	

>   2299		gpmc_base = devm_ioremap_resource(&pdev->dev, res);

>   2300		if (IS_ERR(gpmc_base))

>   2301			return PTR_ERR(gpmc_base);

>   2302	

>   2303		res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);

>   2304		if (!res) {

>   2305			dev_err(&pdev->dev, "Failed to get resource: irq\n");

>   2306			return -ENOENT;

>   2307		}

>   2308	

>   2309		gpmc->irq = res->start;

>   2310	

>   2311		gpmc_l3_clk = devm_clk_get(&pdev->dev, "fck");

>   2312		if (IS_ERR(gpmc_l3_clk)) {

>   2313			dev_err(&pdev->dev, "Failed to get GPMC fck\n");

>   2314			return PTR_ERR(gpmc_l3_clk);

>   2315		}

>   2316	

>   2317		if (!clk_get_rate(gpmc_l3_clk)) {

>   2318			dev_err(&pdev->dev, "Invalid GPMC fck clock rate\n");

>   2319			return -EINVAL;

>   2320		}

>   2321	

>   2322		if (pdev->dev.of_node) {

>   2323			rc = gpmc_probe_dt(pdev);

>   2324			if (rc)

>   2325				return rc;

>   2326		} else {

>   2327			gpmc_cs_num = GPMC_CS_NUM;

>   2328			gpmc_nr_waitpins = GPMC_NR_WAITPINS;

>   2329		}

>   2330	

>   2331		pm_runtime_enable(&pdev->dev);

>   2332		pm_runtime_get_sync(&pdev->dev);

>   2333	

>   2334		l = gpmc_read_reg(GPMC_REVISION);

>   2335	

>   2336		/*

>   2337		 * FIXME: Once device-tree migration is complete the below flags

>   2338		 * should be populated based upon the device-tree compatible

>   2339		 * string. For now just use the IP revision. OMAP3+ devices have

>   2340		 * the wr_access and wr_data_mux_bus register fields. OMAP4+

>   2341		 * devices support the addr-addr-data multiplex protocol.

>   2342		 *

>   2343		 * GPMC IP revisions:

>   2344		 * - OMAP24xx			= 2.0

>   2345		 * - OMAP3xxx			= 5.0

>   2346		 * - OMAP44xx/54xx/AM335x	= 6.0

>   2347		 */

>   2348		if (GPMC_REVISION_MAJOR(l) > 0x4)

>   2349			gpmc_capability = GPMC_HAS_WR_ACCESS | GPMC_HAS_WR_DATA_MUX_BUS;

>   2350		if (GPMC_REVISION_MAJOR(l) > 0x5)

>   2351			gpmc_capability |= GPMC_HAS_MUX_AAD;

>   2352		dev_info(gpmc->dev, "GPMC revision %d.%d\n", GPMC_REVISION_MAJOR(l),

>   2353			 GPMC_REVISION_MINOR(l));

>   2354	

>   2355		gpmc_mem_init();

>   2356		rc = gpmc_gpio_init(gpmc);

>   2357		if (rc)

>   2358			goto gpio_init_failed;

>   2359	

>   2360		gpmc->nirqs = GPMC_NR_NAND_IRQS + gpmc_nr_waitpins;

>   2361		rc = gpmc_setup_irq(gpmc);

>   2362		if (rc) {

>   2363			dev_err(gpmc->dev, "gpmc_setup_irq failed\n");

>   2364			goto setup_irq_failed;

>   2365		}

>   2366	

>   2367		rc = gpmc_probe_dt_children(pdev);

>   2368		if (rc < 0) {

>   2369			dev_err(gpmc->dev, "failed to probe DT children\n");

>   2370			goto dt_children_failed;

>   2371		}

>   2372	

>   2373		return 0;

>   2374	

>   2375	dt_children_failed:

>   2376		gpmc_free_irq(gpmc);

>   2377	setup_irq_failed:

>> 2378		gpmc_gpio_exit(gpmc);

>   2379	gpio_init_failed:

>   2380		gpmc_mem_exit();

>   2381		pm_runtime_put_sync(&pdev->dev);

> 

> ---

> 0-DAY kernel test infrastructure                Open Source Technology Center

> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

> 


Looks like we need to patch this with


--
cheers,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Linus Walleij Aug. 10, 2016, 1:39 p.m. UTC | #1
On Mon, Aug 8, 2016 at 12:37 PM, Roger Quadros <rogerq@ti.com> wrote:

> Looks like we need to patch this with

>

> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c

> index 68f0a92..dff7b9e 100644

> --- a/drivers/memory/omap-gpmc.c

> +++ b/drivers/memory/omap-gpmc.c

> @@ -2359,7 +2359,7 @@ static int gpmc_probe(struct platform_device *pdev)

>         rc = gpmc_setup_irq(gpmc);

>         if (rc) {

>                 dev_err(gpmc->dev, "gpmc_setup_irq failed\n");

> -               goto setup_irq_failed;

> +               goto gpio_init_failed;

>         }

>

>         rc = gpmc_probe_dt_children(pdev);

> @@ -2372,8 +2372,6 @@ static int gpmc_probe(struct platform_device *pdev)

>

>  dt_children_failed:

>         gpmc_free_irq(gpmc);

> -setup_irq_failed:

> -       gpmc_gpio_exit(gpmc);


Thanks Roger, sorry about my screwups :(
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>


Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Roger Quadros Aug. 12, 2016, 9:52 a.m. UTC | #2
On 10/08/16 16:39, Linus Walleij wrote:
> On Mon, Aug 8, 2016 at 12:37 PM, Roger Quadros <rogerq@ti.com> wrote:

> 

>> Looks like we need to patch this with

>>

>> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c

>> index 68f0a92..dff7b9e 100644

>> --- a/drivers/memory/omap-gpmc.c

>> +++ b/drivers/memory/omap-gpmc.c

>> @@ -2359,7 +2359,7 @@ static int gpmc_probe(struct platform_device *pdev)

>>         rc = gpmc_setup_irq(gpmc);

>>         if (rc) {

>>                 dev_err(gpmc->dev, "gpmc_setup_irq failed\n");

>> -               goto setup_irq_failed;

>> +               goto gpio_init_failed;

>>         }

>>

>>         rc = gpmc_probe_dt_children(pdev);

>> @@ -2372,8 +2372,6 @@ static int gpmc_probe(struct platform_device *pdev)

>>

>>  dt_children_failed:

>>         gpmc_free_irq(gpmc);

>> -setup_irq_failed:

>> -       gpmc_gpio_exit(gpmc);

> 

> Thanks Roger, sorry about my screwups :(

> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

> 


Thanks. I'll merge this change into your original patch.

regards,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index 68f0a92..dff7b9e 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -2359,7 +2359,7 @@  static int gpmc_probe(struct platform_device *pdev)
 	rc = gpmc_setup_irq(gpmc);
 	if (rc) {
 		dev_err(gpmc->dev, "gpmc_setup_irq failed\n");
-		goto setup_irq_failed;
+		goto gpio_init_failed;
 	}
 
 	rc = gpmc_probe_dt_children(pdev);
@@ -2372,8 +2372,6 @@  static int gpmc_probe(struct platform_device *pdev)
 
 dt_children_failed:
 	gpmc_free_irq(gpmc);
-setup_irq_failed:
-	gpmc_gpio_exit(gpmc);
 gpio_init_failed:
 	gpmc_mem_exit();
 	pm_runtime_put_sync(&pdev->dev);