[PATCH 4/9] mci: core: add manufacturing date extraction function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This function operates on a string buffer and concatenates both the year
and month. It will be used later when the mdt is added as a parameter.

Signed-off-by: Stefan Kerkmann <s.kerkmann@xxxxxxxxxxxxxx>
---
 drivers/mci/mci-core.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index df72445edd..48eee35f2c 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -2030,6 +2030,20 @@ static unsigned extract_mdt_year(struct mci *mci)
 	return year;
 }
 
+/**
+ * Extract the manufacturing date from the CID
+ * @param mci Instance data
+ *
+ * The 'MDT' is encoded in bit 19:8 in the CID
+ */
+static void extract_mdt(struct mci *mci, char mdt[static 8])
+{
+	unsigned month = extract_mdt_month(mci);
+	unsigned year = extract_mdt_year(mci);
+
+	snprintf(mdt, 8, "%u.%u", year, month);
+}
+
 static const char *mci_timing_tostr(unsigned timing)
 {
 	switch (timing) {

-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux