mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: [PATCH 4/8] devfs-core: add function to find cdev by partuuid
Date: Wed,  5 Jul 2017 12:56:33 +0200	[thread overview]
Message-ID: <20170705105637.4484-4-s.trumtrar@pengutronix.de> (raw)
In-Reply-To: <20170705105637.4484-1-s.trumtrar@pengutronix.de>

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 fs/devfs-core.c  | 14 ++++++++++++++
 include/driver.h |  1 +
 2 files changed, 15 insertions(+)

diff --git a/fs/devfs-core.c b/fs/devfs-core.c
index 3368d3ed68bd..be56edd18d80 100644
--- a/fs/devfs-core.c
+++ b/fs/devfs-core.c
@@ -95,6 +95,20 @@ struct cdev *cdev_by_device_node(struct device_node *node)
 	return NULL;
 }
 
+struct cdev *cdev_by_partuuid(const char *partuuid)
+{
+	struct cdev *cdev;
+
+	if (!partuuid)
+		return NULL;
+
+	list_for_each_entry(cdev, &cdev_list, list) {
+		if (!strcmp(cdev->partuuid, partuuid))
+			return cdev;
+	}
+	return NULL;
+}
+
 /**
  * device_find_partition - find a partition belonging to a physical device
  *
diff --git a/include/driver.h b/include/driver.h
index 3d701f24398a..8617872053d8 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -472,6 +472,7 @@ struct cdev *cdev_by_name(const char *filename);
 struct cdev *lcdev_by_name(const char *filename);
 struct cdev *cdev_readlink(struct cdev *cdev);
 struct cdev *cdev_by_device_node(struct device_node *node);
+struct cdev *cdev_by_partuuid(const char *partuuid);
 struct cdev *cdev_open(const char *name, unsigned long flags);
 struct cdev *cdev_create_loop(const char *path, ulong flags);
 void cdev_remove_loop(struct cdev *cdev);
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2017-07-05 10:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05 10:56 [PATCH 1/8] state: fix compile warnings for dev_err expansion Steffen Trumtrar
2017-07-05 10:56 ` [PATCH 2/8] common: efi: do not use undefined kconfig option Steffen Trumtrar
2017-07-05 11:05   ` Lucas Stach
2017-07-06  7:31     ` Michael Olbrich
2017-07-05 10:56 ` [PATCH 3/8] fs: efi: return with correct error code in efifs_stat Steffen Trumtrar
2017-07-05 10:56 ` Steffen Trumtrar [this message]
2017-07-05 10:56 ` [PATCH 5/8] of: of_path: find device via partuuid Steffen Trumtrar
2017-07-05 10:56 ` [PATCH 6/8] efi: efi: load state from devicetree Steffen Trumtrar
2017-07-05 12:38   ` Lucas Stach
2017-07-05 10:56 ` [PATCH 7/8] blspec: skip all devicetree tests if entry doesn't specify one Steffen Trumtrar
2017-07-05 10:56 ` [PATCH 8/8] efi: efi: register barebox-update handler Steffen Trumtrar

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=20170705105637.4484-4-s.trumtrar@pengutronix.de \
    --to=s.trumtrar@pengutronix.de \
    --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