Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3424309ybi; Fri, 5 Jul 2019 07:07:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbpk0oF0PqlTu/pv1mtw6bB9Ix6Z0WaOOw7bK4a6V+hnB93o4txxu5jAdzN/jQt7dyVl2q X-Received: by 2002:a17:902:26c:: with SMTP id 99mr6083498plc.215.1562335653999; Fri, 05 Jul 2019 07:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562335653; cv=none; d=google.com; s=arc-20160816; b=da8Bhm+jy4FJC4LGlZ5aBcbmO0eKwPRQ31P1wG8WETiKFMApjxtM59y4g6zftodf5R Gp+uoz+b/5O8UzyMsclrAmPEG8iBRf+52GOblCZy75grrUPTtnvO9pHIRb8utawu2qfp 6mNvaDjqahZVF4s49wSMQkhTRTmZIaH3T2jYJAflBkbgDgCtElB7MFNChH8tjYf1Qrlw xbtg75sNI+dlBpM79gajqjZyNiUZ8miGmVyA+nCq1pQPYct3HcMk3e9/TYzC8vbRpP7N rlXjmVA561CfuXm39HW/VBm12K86ouB9XAxwjI9a9cG3mO8w4j24BZL2yw3YV9/lTkyH aF+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=OeYKktnWRBREEE8uCNGWJISNCGvPYht7I3arWEIgZ9o=; b=EobfwYSPfYSL1p0ncrgWI3wbTy7zZVeEvXAIDaf4zujprlMe8W5c7BrbmIBuRksUs9 iV53h17QCAeJGUz5wk01z57tPfg4Lr+BML3RkkTCxe4MSXSSQIYCbHHrxqtenU7VG5Pl oxqSKLwtHSIZ0r3BxPoij7f6iIUddxasckCVm/WVToPQuYgi/bBRzMTtKkk6Z3yO7UeS JxMOtDrYHkq/6ObiVkrsW3RAP9sn23uTgWS/QaVoDeKTb2vfBf1EAKPnDtmrWT79TTWW I5uA4R4Smnd4O9mH2lszBK6WdxX6kzmBbusgRFj0864WePOcvcD5q/p4HVgiw0TA1gxs /Wjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e123si9595196pfa.252.2019.07.05.07.07.18; Fri, 05 Jul 2019 07:07:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728741AbfGEMoQ (ORCPT + 99 others); Fri, 5 Jul 2019 08:44:16 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8146 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727665AbfGEMoQ (ORCPT ); Fri, 5 Jul 2019 08:44:16 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1D377A7AB501FDE1A7EA; Fri, 5 Jul 2019 20:44:13 +0800 (CST) Received: from [127.0.0.1] (10.133.213.239) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Fri, 5 Jul 2019 20:44:12 +0800 Subject: Re: [PATCH] gpio: tegra: Fix build error without CONFIG_DEBUG_FS To: Bartosz Golaszewski References: <20190705123220.54008-1-yuehaibing@huawei.com> CC: Linus Walleij , Thierry Reding , Jonathan Hunter , LKML , linux-gpio , From: Yuehaibing Message-ID: <74ffe8ea-e6fb-bd2a-42bd-08392eb27c69@huawei.com> Date: Fri, 5 Jul 2019 20:44:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/7/5 20:40, Bartosz Golaszewski wrote: > pt., 5 lip 2019 o 14:34 YueHaibing napisaƂ(a): >> >> If CONFIG_DEBUG_FS is not set, building fails: >> >> drivers/gpio/gpio-tegra.c: In function tegra_gpio_probe: >> drivers/gpio/gpio-tegra.c:665:2: error: implicit declaration of function debugfs_create_file; >> did you mean bus_create_file? [-Werror=implicit-function-declaration] >> debugfs_create_file("tegra_gpio", 0444, NULL, tgi, >> ^~~~~~~~~~~~~~~~~~~ >> bus_create_file >> drivers/gpio/gpio-tegra.c:666:9: error: tegra_dbg_gpio_fops undeclared (first use in this function); >> did you mean tegra_gpio_pm_ops? >> &tegra_dbg_gpio_fops); >> ^~~~~~~~~~~~~~~~~~~ >> tegra_gpio_pm_ops >> >> Reported-by: Hulk Robot >> Fixes: a4de43049a1d ("gpio: tegra: Clean-up debugfs initialisation") >> Signed-off-by: YueHaibing >> --- >> drivers/gpio/gpio-tegra.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c >> index 59b99d8..40fd6bd 100644 >> --- a/drivers/gpio/gpio-tegra.c >> +++ b/drivers/gpio/gpio-tegra.c >> @@ -662,8 +662,10 @@ static int tegra_gpio_probe(struct platform_device *pdev) >> } >> } >> >> +#ifdef CONFIG_DEBUG_FS >> debugfs_create_file("tegra_gpio", 0444, NULL, tgi, >> &tegra_dbg_gpio_fops); >> +#endif >> >> return 0; >> } >> -- >> 2.7.4 >> >> > > Nack, there are inline stubs for all debugfs functions in > ./include/linux/debugfs.h if CONFIG_DEBUG_FS is not selected. Just > move the #include to the top of the source file. yes, agree this, but 'tegra_dbg_gpio_fops' is still undeclared. > > Bart > > . >