All of lore.kernel.org
 help / color / mirror / Atom feed
* + rtc-ds1307-refactor-chip_desc-table.patch added to -mm tree
@ 2012-02-24 20:16 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2012-02-24 20:16 UTC (permalink / raw)
  To: mm-commits; +Cc: w.sang, Austin.Boyle, alessandro.zummo, danders.dev


The patch titled
     Subject: rtc: ds1307: refactor chip_desc table
has been added to the -mm tree.  Its filename is
     rtc-ds1307-refactor-chip_desc-table.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Wolfram Sang <w.sang@pengutronix.de>
Subject: rtc: ds1307: refactor chip_desc table

The chip_desc table is suboptimal.  Currently it requires an entry for
every new chip type, even if it is empty.  This has already been forgotten
for the ds1388.  Refactor the code, so new entries are only needed, when
they chip type really needs a (non-empty) description.  Also make the
table visually more appealing.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Austin Boyle <Austin.Boyle@aviatnet.com>
Cc: David Anders <danders.dev@gmail.com>
Cc: Alessandro Zummo <alessandro.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/rtc/rtc-ds1307.c |   48 ++++++++++++++-----------------------
 1 file changed, 19 insertions(+), 29 deletions(-)

diff -puN drivers/rtc/rtc-ds1307.c~rtc-ds1307-refactor-chip_desc-table drivers/rtc/rtc-ds1307.c
--- a/drivers/rtc/rtc-ds1307.c~rtc-ds1307-refactor-chip_desc-table
+++ a/drivers/rtc/rtc-ds1307.c
@@ -36,6 +36,7 @@ enum ds_type {
 	m41t00,
 	mcp7941x,
 	rx_8025,
+	last_ds_type /* always last */
 	// rs5c372 too?  different address...
 };
 
@@ -120,30 +121,23 @@ struct chip_desc {
 	unsigned		alarm:1;
 };
 
-static const struct chip_desc chips[] = {
-[ds_1307] = {
-	.nvram56	= 1,
-},
-[ds_1337] = {
-	.alarm		= 1,
-},
-[ds_1338] = {
-	.nvram56	= 1,
-},
-[ds_1339] = {
-	.alarm		= 1,
-},
-[ds_1340] = {
-},
-[ds_3231] = {
-	.alarm		= 1,
-},
-[m41t00] = {
-},
-[mcp7941x] = {
-},
-[rx_8025] = {
-}, };
+static const struct chip_desc chips[last_ds_type] = {
+	[ds_1307] = {
+		.nvram56	= 1,
+	},
+	[ds_1337] = {
+		.alarm		= 1,
+	},
+	[ds_1338] = {
+		.nvram56	= 1,
+	},
+	[ds_1339] = {
+		.alarm		= 1,
+	},
+	[ds_3231] = {
+		.alarm		= 1,
+	},
+};
 
 static const struct i2c_device_id ds1307_id[] = {
 	{ "ds1307", ds_1307 },
@@ -836,11 +830,7 @@ read_rtc:
 		}
 
 		break;
-	case rx_8025:
-	case ds_1337:
-	case ds_1339:
-	case ds_1388:
-	case ds_3231:
+	default:
 		break;
 	}
 
_
Subject: Subject: rtc: ds1307: refactor chip_desc table

Patches currently in -mm which might be from w.sang@pengutronix.de are

linux-next.patch
rtc-ds1307-refactor-chip_desc-table.patch
rtc-ds1307-simplify-irq-setup-code.patch
rtc-ds1307-comment-and-format-cleanup.patch
rtc-ds1307-generalise-ram-size-and-offset.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-24 20:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-24 20:16 + rtc-ds1307-refactor-chip_desc-table.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.