From: Arnd Bergmann <arnd@arndb.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
linux-kernel@vger.kernel.org,
"spear-devel" <spear-devel@list.st.com>
Subject: Re: [PATCH 3/4] dw_dmac: make build of DT related methods optional
Date: Mon, 25 Mar 2013 22:09:30 +0000 [thread overview]
Message-ID: <201303252209.30634.arnd@arndb.de> (raw)
In-Reply-To: <1364202254.18714.101.camel@smile>
On Monday 25 March 2013, Andy Shevchenko wrote:
> > I generally prefer to have all driver code be compiled all the time
> > to catch build regressions independent of the configuration, and leave
> > the #ifdefs in header files that provide the interfaces.
>
> I don't. For checking we have special make targets:
>
> allnoconfig - New config where all options are answered with no
> allyesconfig - New config where all options are accepted with yes
> allmodconfig - New config selecting modules when possible
> alldefconfig - New config with all symbols set to default
That will only help on architectures that support CONFIG_OF, although
that probably includes all the common ones except s390 and ia64 nowadays.
> > if (IS_ENABLED(CONFIG_OF)) && pdev->dev.of_node) {
> > err = of_dma_controller_register(pdev->dev.of_node,
> > dw_dma_of_xlate, dw);
> > if (err)
> > dev_err(&pdev->dev,
> > "could not register of_dma_controller\n");
> > }
> >
> > Or alternatively, we can change the of_dma_controller_register() stub to
> > return 0 if CONFIG_OF is disabled. That would also take care of similar
> > code in other dma engine drivers.
>
> Actually to be aligned with other dmaengine code it should return
> -ENOSYS. And by description ENOSYS seems suitable for "not implemented"
> cases.
I think we use ENOSYS normally when the absence of the interface is
a fatal error, which it would not be here. This case I think is more
like the clk and regulator interfaces, where you want to bail out
if the functions return an actual error but not if the subsystem is
compiled out.
> What about to move all CONFIG_OF stuff into separate file?
Seems not worth it, and still would lead to the code not being
compile tested by default. Right now, there are two small functions,
and I would hope we can turn that into a single even smaller
function eventually if we get right of the silly requirement to
go through a filter function here.
Arnd
next prev parent reply other threads:[~2013-03-25 22:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-22 14:43 [PATCH 0/4] dw_dmac: cleanup for DT usage Andy Shevchenko
2013-03-22 14:43 ` [PATCH 1/4] dw_dmac: fix style of the comments Andy Shevchenko
2013-03-23 6:46 ` Viresh Kumar
2013-03-22 14:43 ` [PATCH 2/4] dw_dmac: rename DT related methods to reflect their belonging Andy Shevchenko
2013-03-23 6:47 ` Viresh Kumar
2013-03-22 14:43 ` [PATCH 3/4] dw_dmac: make build of DT related methods optional Andy Shevchenko
2013-03-22 15:19 ` Arnd Bergmann
2013-03-25 9:04 ` Andy Shevchenko
2013-03-25 22:09 ` Arnd Bergmann [this message]
2013-03-22 14:43 ` [PATCH 4/4] dmaengine: dw_dmac: simplify master selection Andy Shevchenko
2013-03-23 6:55 ` Viresh Kumar
2013-03-22 15:20 ` [PATCH 0/4] dw_dmac: cleanup for DT usage Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201303252209.30634.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=spear-devel@list.st.com \
--cc=vinod.koul@intel.com \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome