linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] staging: ccree: Employ devm_* functions, remove redundant code
@ 2017-07-15  7:51 sunil.m
  2017-07-15  7:51 ` [PATCH 1/3] staging: ccree: Replace kzalloc with devm_kzalloc sunil.m
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: sunil.m @ 2017-07-15  7:51 UTC (permalink / raw)
  To: gregkh, gilad
  Cc: linux-crypto, driverdev-devel, devel, linux-kernel, karthik,
	Suniel Mahesh

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-07-30 16:19 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-15  7:51 [PATCH 0/3] staging: ccree: Employ devm_* functions, remove redundant code sunil.m
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

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).