From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <ahmad@a3f.at>
Subject: [PATCH] misc: sram: remove duplicated resource handling code
Date: Sat, 11 Dec 2021 09:44:06 +0100 [thread overview]
Message-ID: <20211211084406.448795-1-ahmad@a3f.at> (raw)
Remove superfluous code. No functional change.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
drivers/misc/sram.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index d45b5cb72f93..f4a7551fc760 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -26,24 +26,17 @@ static int sram_probe(struct device_d *dev)
{
struct resource *iores;
struct sram *sram;
- struct resource *res;
- void __iomem *base;
int ret;
iores = dev_request_mem_resource(dev, 0);
if (IS_ERR(iores))
return PTR_ERR(iores);
- base = IOMEM(iores->start);
sram = xzalloc(sizeof(*sram));
sram->cdev.name = basprintf("sram%d", cdev_find_free_index("sram"));
- res = dev_get_resource(dev, IORESOURCE_MEM, 0);
- if (IS_ERR(res))
- return PTR_ERR(res);
-
- sram->cdev.size = (unsigned long)resource_size(res);
+ sram->cdev.size = (unsigned long)resource_size(iores);
sram->cdev.ops = &memops;
sram->cdev.dev = dev;
--
2.33.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2021-12-11 8:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-11 8:44 Ahmad Fatoum [this message]
2021-12-13 22:23 ` Sascha Hauer
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=20211211084406.448795-1-ahmad@a3f.at \
--to=ahmad@a3f.at \
--cc=barebox@lists.infradead.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