From: sunil.m@techveda.org
To: gregkh@linuxfoundation.org, gilad@benyossef.com
Cc: linux-crypto@vger.kernel.org,
driverdev-devel@linuxdriverproject.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
karthik@techveda.org, Suniel Mahesh <sunil.m@techveda.org>
Subject: [PATCH 0/3] staging: ccree: Employ devm_* functions, remove redundant code
Date: Sat, 15 Jul 2017 13:21:53 +0530 [thread overview]
Message-ID: <1500105116-30290-1-git-send-email-sunil.m@techveda.org> (raw)
From: Suniel Mahesh <sunil.m@techveda.org>
Hi
This patch series replaces the current API's which request
for device resources in driver probe, with devm_*() functions
of the kernel framework as recommended by the kernel community.
Doing so simplifies driver cleanup paths and code organization.
The current set of API's whch request for device resources are
not device managed.
The devm_*() functions of the kernel framework are kernel managed
resources which the kernel tracks and then automatically releases
them when the device goes away.
Patch 1/3, replaces kzalloc with devm_kzalloc, kfree's and blank
lines are removed accordingly.
Patch 2/3, utilizes devm_ioremap_resource for map and unmap of
device resources.
request_mem_region(), ioremap() and corresponding error handling
is replaced with devm_ioremap_resource().
release_mem_region() and iounmap() are dropped. A struct member in
struct ssi_drvdata is dropped as it seemed redundant. Log messages
adjusted accordingly.
Patch 3/3, replaces platform_get_resource(), request_irq() and
corresponding error handling with platform_get_irq() and
devm_request_irq().
free_irq is not required any more, devm_request_irq() free's it on
driver detach.
A struct member in struct ssi_drvdata and a bool variable in driver probe
are dropped as they seemed redundant.
Changed type of a member in struct ssi_drvdata to use it with platform_get_irq().
Log messages adjusted accordingly.
Note:
Patch was tested and built(ARCH=arm) on next-20170714.
No build issues reported, however it was not tested on
real hardware.
Please drop any patch if they break the flow. As per my
analysis these changes should not create a problem.
Thanks, Suniel
Suniel Mahesh (3):
staging: ccree: Replace kzalloc with devm_kzalloc
staging: ccree: Convert to devm_ioremap_resource for map, unmap
staging: ccree: Use platform_get_irq and devm_request_irq
drivers/staging/ccree/ssi_driver.c | 92 +++++++++++---------------------------
drivers/staging/ccree/ssi_driver.h | 4 +-
2 files changed, 26 insertions(+), 70 deletions(-)
--
1.9.1
next reply other threads:[~2017-07-15 7:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-15 7:51 sunil.m [this message]
2017-07-15 7:51 ` [PATCH 1/3] staging: ccree: Replace kzalloc with devm_kzalloc sunil.m
2017-07-17 12:33 ` Greg KH
2017-07-18 4:34 ` Suniel Mahesh
2017-07-18 10:58 ` [PATCH v2 " sunil.m
2017-07-18 10:58 ` [PATCH v2 2/3] staging: ccree: Convert to devm_ioremap_resource for map, unmap sunil.m
2017-07-18 10:58 ` [PATCH v2 3/3] staging: ccree: Use platform_get_irq and devm_request_irq sunil.m
2017-07-27 14:26 ` [PATCH v2 1/3] staging: ccree: Replace kzalloc with devm_kzalloc Gilad Ben-Yossef
2017-07-27 14:27 ` [PATCH " Gilad Ben-Yossef
2017-07-27 14:27 ` [PATCH 2/3] staging: ccree: Convert to devm_ioremap_resource for map, unmap Gilad Ben-Yossef
2017-07-27 19:48 ` Dan Carpenter
2017-07-28 4:29 ` Suniel Mahesh
2017-07-28 8:40 ` Dan Carpenter
2017-07-30 16:19 ` Gilad Ben-Yossef
2017-07-27 14:27 ` [PATCH 3/3] staging: ccree: Use platform_get_irq and devm_request_irq Gilad Ben-Yossef
2017-07-28 4:56 ` [PATCH 1/3] staging: ccree: Replace kzalloc with devm_kzalloc Greg Kroah-Hartman
2017-07-15 7:51 ` [PATCH 2/3] staging: ccree: Convert to devm_ioremap_resource for map, unmap sunil.m
2017-07-15 7:51 ` [PATCH 3/3] staging: ccree: Use platform_get_irq and devm_request_irq sunil.m
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=1500105116-30290-1-git-send-email-sunil.m@techveda.org \
--to=sunil.m@techveda.org \
--cc=devel@driverdev.osuosl.org \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gilad@benyossef.com \
--cc=gregkh@linuxfoundation.org \
--cc=karthik@techveda.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®