Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1360428 > unrolled thread
| Started by | Jan Glauber <jglauber@cavium.com> |
|---|---|
| First post | 2016-03-18 09:50 +0100 |
| Last post | 2016-03-23 21:00 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v4 02/14] i2c-octeon: Cleanup resource allocation code Jan Glauber <jglauber@cavium.com> - 2016-03-18 09:50 +0100
Re: [PATCH v4 02/14] i2c-octeon: Cleanup resource allocation code Wolfram Sang <wsa@the-dreams.de> - 2016-03-23 21:00 +0100
| From | Jan Glauber <jglauber@cavium.com> |
|---|---|
| Date | 2016-03-18 09:50 +0100 |
| Subject | [PATCH v4 02/14] i2c-octeon: Cleanup resource allocation code |
| Message-ID | <rdYgy-3aq-21@gated-at.bofh.it> |
Remove resource values from struct i2c_octeon and use
devm_ioremap_resource helper.
Signed-off-by: Jan Glauber <jglauber@cavium.com>
---
drivers/i2c/busses/i2c-octeon.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c
index 9787379..9240037 100644
--- a/drivers/i2c/busses/i2c-octeon.c
+++ b/drivers/i2c/busses/i2c-octeon.c
@@ -75,9 +75,7 @@ struct octeon_i2c {
int irq;
u32 twsi_freq;
int sys_freq;
- resource_size_t twsi_phys;
void __iomem *twsi_base;
- resource_size_t regsize;
struct device *dev;
};
@@ -502,14 +500,11 @@ static int octeon_i2c_probe(struct platform_device *pdev)
i2c->dev = &pdev->dev;
res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
- if (res_mem == NULL) {
- dev_err(i2c->dev, "found no memory resource\n");
- result = -ENXIO;
+ i2c->twsi_base = devm_ioremap_resource(&pdev->dev, res_mem);
+ if (IS_ERR(i2c->twsi_base)) {
+ result = PTR_ERR(i2c->twsi_base);
goto out;
}
- i2c->twsi_phys = res_mem->start;
- i2c->regsize = resource_size(res_mem);
/*
* "clock-rate" is a legacy binding, the official binding is
@@ -526,13 +521,6 @@ static int octeon_i2c_probe(struct platform_device *pdev)
i2c->sys_freq = octeon_get_io_clock_rate();
- if (!devm_request_mem_region(&pdev->dev, i2c->twsi_phys, i2c->regsize,
- res_mem->name)) {
- dev_err(i2c->dev, "request_mem_region failed\n");
- goto out;
- }
- i2c->twsi_base = devm_ioremap(&pdev->dev, i2c->twsi_phys, i2c->regsize);
-
init_waitqueue_head(&i2c->queue);
i2c->irq = irq;
--
1.9.1
[toc] | [next] | [standalone]
| From | Wolfram Sang <wsa@the-dreams.de> |
|---|---|
| Date | 2016-03-23 21:00 +0100 |
| Message-ID | <rfX6G-8f8-7@gated-at.bofh.it> |
| In reply to | #1360428 |
[Multipart message — attachments visible in raw view] — view raw
On Fri, Mar 18, 2016 at 09:46:27AM +0100, Jan Glauber wrote: > Remove resource values from struct i2c_octeon and use > devm_ioremap_resource helper. > > Signed-off-by: Jan Glauber <jglauber@cavium.com> Like patch 1, this is already upstream.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web