From: Satendra Singh Thakur <sst2005@gmail.com>
To: dan.j.williams@intel.com, vkoul@kernel.org, jun.nie@linaro.org,
shawnguo@kernel.org, agross@kernel.org, sean.wang@mediatek.com,
matthias.bgg@gmail.com, maxime.ripard@bootlin.com, wens@csie.org,
lars@metafoo.de, afaerber@suse.de,
manivannan.sadhasivam@linaro.org
Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
satendrasingh.thakur@hcl.com, dmaengine@vger.kernel.org,
Satendra Singh Thakur <sst2005@gmail.com>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/9] added helper macros to remove duplicate code from probe functions of the platform drivers
Date: Sun, 15 Sep 2019 12:30:03 +0530 [thread overview]
Message-ID: <20190915070003.21260-1-sst2005@gmail.com> (raw)
1. For most of the platform drivers's probe include following steps
-memory allocation for driver's private structure
-getting io resources
-io remapping resources
-getting irq number
-registering irq
-setting driver's private data
-getting clock
-preparing and enabling clock
2. We have defined a set of macros to combine some or all of
the above mentioned steps. This will remove redundant/duplicate
code in drivers' probe functions of platform drivers.
devm_platform_probe_helper(pdev, priv, clk_name);
devm_platform_probe_helper_clk(pdev, priv, clk_name);
devm_platform_probe_helper_irq(pdev, priv, clk_name,
irq_hndlr, irq_flags, irq_name, irq_devid);
devm_platform_probe_helper_all(pdev, priv, clk_name,
irq_hndlr, irq_flags, irq_name, irq_devid);
devm_platform_probe_helper_all_data(pdev, priv, clk_name,
irq_hndlr, irq_flags, irq_name, irq_devid);
3. Code is made devres compatible (wherever required)
The functions: clk_get, request_irq, kzalloc, platform_get_resource
are replaced with their devm_* counterparts.
4. Few bugs are also fixed.
Satendra Singh Thakur (9):
probe/dma : added helper macros to remove redundant/duplicate code
from probe functions of the dma controller drivers
probe/dma/jz4740: removed redundant code from jz4740 dma controller's
probe function
probe/dma/zx: removed redundant code from zx dma controller's probe
function
probe/dma/qcom-bam: removed redundant code from qcom bam dma
controller's probe function
probe/dma/mtk-hs: removed redundant code from mediatek hs dma
controller's probe function
probe/dma/sun6i: removed redundant code from sun6i dma controller's
probe function
probe/dma/sun4i: removed redundant code from sun4i dma controller's
probe function
probe/dma/axi: removed redundant code from axi dma controller's probe
function
probe/dma/owl: removed redundant code from owl dma controller's probe
function
drivers/dma/dma-axi-dmac.c | 28 ++---
drivers/dma/dma-jz4740.c | 33 +++---
drivers/dma/mediatek/mtk-hsdma.c | 38 +++----
drivers/dma/owl-dma.c | 29 ++---
drivers/dma/qcom/bam_dma.c | 71 +++++-------
drivers/dma/sun4i-dma.c | 30 ++----
drivers/dma/sun6i-dma.c | 30 ++----
drivers/dma/zx_dma.c | 35 ++----
include/linux/probe-helper.h | 179 +++++++++++++++++++++++++++++++
9 files changed, 280 insertions(+), 193 deletions(-)
create mode 100644 include/linux/probe-helper.h
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2019-09-15 7:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-15 7:00 Satendra Singh Thakur [this message]
2019-09-15 7:26 ` [PATCH 1/9] probe/dma : added helper macros to remove redundant/duplicate code from probe functions of the dma controller drivers Satendra Singh Thakur
2019-09-15 7:29 ` [PATCH 3/9] probe/dma/zx: removed redundant code from zx dma controller's probe function Satendra Singh Thakur
2019-09-15 7:30 ` [PATCH 5/9] probe/dma/mtk-hs: removed redundant code from mediatek hs " Satendra Singh Thakur
2019-09-15 7:31 ` [PATCH 6/9] probe/dma/sun6i: removed redundant code from sun6i " Satendra Singh Thakur
2019-09-15 7:32 ` [PATCH 7/9] probe/dma/sun4i: removed redundant code from sun4i " Satendra Singh Thakur
2019-09-15 7:32 ` [PATCH 9/9] probe/dma/owl: removed redundant code from owl " Satendra Singh Thakur
2019-09-18 10:27 ` [PATCH 0/9] added helper macros to remove duplicate code from probe functions of the platform drivers Vinod Koul
2019-09-21 14:57 ` Satendra Singh Thakur
2019-09-24 19:27 ` Vinod Koul
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=20190915070003.21260-1-sst2005@gmail.com \
--to=sst2005@gmail.com \
--cc=afaerber@suse.de \
--cc=agross@kernel.org \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=jun.nie@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=matthias.bgg@gmail.com \
--cc=maxime.ripard@bootlin.com \
--cc=satendrasingh.thakur@hcl.com \
--cc=sean.wang@mediatek.com \
--cc=shawnguo@kernel.org \
--cc=vkoul@kernel.org \
--cc=wens@csie.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;
as well as URLs for NNTP newsgroup(s).