Skip to contentSkip to conversation

usb: host: uhci-grlib.c : use devm_ functions

PATCH Alan Stern 1 participant 1 message Jun 11, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20140610164548.GA5567@himangi-Dell

Alan Stern

author
#1 lore raw
Quoted 14 lines · Himangi Saraogi

The various devm_ functions allocate memory that is released when a driver detaches. This patch uses devm_ioremap_resource for data that is allocated in the probe function of a platform device and is only freed in the remove function. The corresponding free functions are removed and two labels are done away with. Also, linux/device.h is added to make sure the devm_*() routine declarations are unambiguously available.

---
v2: fix error of devm_ioremap_resource and change label names.

Review

Quoted 1 line
(quoted diff) +1 -0
+	hcd->regs = devm_ioremap_resource(&op->dev, hcd);

Obviously you haven't tried to compile this.

Alan Stern