linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] OMAP Mailbox legacy platform device support removal
@ 2016-04-06 17:37 Suman Anna
  2016-04-06 17:37 ` [PATCH 1/4] mailbox/omap: drop legacy platform device support Suman Anna
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Suman Anna @ 2016-04-06 17:37 UTC (permalink / raw)
  To: Jassi Brar; +Cc: linux-kernel, linux-omap, Suman Anna

Hi Jassi,

This series cleans up the OMAP Mailbox driver dropping the
support for legacy non-DT platform devices. The infrastructure
for creating any such devices has all been cleaned up from the
mach-omap2 layers.

The removal from the driver is accomplished in patch 1, while the
remaining patches do some minor checkpatch fixes.

Patches baselined on 4.6-rc2.

regards
Suman

Suman Anna (4):
  mailbox/omap: drop legacy platform device support
  mailbox/omap: use variable name for sizeof() operator
  mailbox/omap: remove FSF mailing address paragraph
  mailbox/omap: add blank lines after declarations

 drivers/mailbox/omap-mailbox.c             | 116 ++++++++++++-----------------
 include/linux/platform_data/mailbox-omap.h |  58 ---------------
 2 files changed, 48 insertions(+), 126 deletions(-)
 delete mode 100644 include/linux/platform_data/mailbox-omap.h

-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] mailbox/omap: drop legacy platform device support
  2016-04-06 17:37 [PATCH 0/4] OMAP Mailbox legacy platform device support removal Suman Anna
@ 2016-04-06 17:37 ` Suman Anna
  2016-04-06 17:37 ` [PATCH 2/4] mailbox/omap: use variable name for sizeof() operator Suman Anna
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Suman Anna @ 2016-04-06 17:37 UTC (permalink / raw)
  To: Jassi Brar; +Cc: linux-kernel, linux-omap, Suman Anna

OMAP mailbox devices can no longer be created in legacy non-DT
mode, all the relevant code has been cleaned up. The OMAP mailbox
driver will only support devices created from DT going forward,
so drop the legacy platform device support from the driver.

Signed-off-by: Suman Anna <s-anna@ti.com>
---
 drivers/mailbox/omap-mailbox.c             | 101 ++++++++++++-----------------
 include/linux/platform_data/mailbox-omap.h |  58 -----------------
 2 files changed, 41 insertions(+), 118 deletions(-)
 delete mode 100644 include/linux/platform_data/mailbox-omap.h

diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c
index b7f636f15cac..ea06072c7322 100644
--- a/drivers/mailbox/omap-mailbox.c
+++ b/drivers/mailbox/omap-mailbox.c
@@ -2,7 +2,7 @@
  * OMAP mailbox driver
  *
  * Copyright (C) 2006-2009 Nokia Corporation. All rights reserved.
- * Copyright (C) 2013-2014 Texas Instruments Inc.
+ * Copyright (C) 2013-2016 Texas Instruments Incorporated - http://www.ti.com
  *
  * Contact: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
  *          Suman Anna <s-anna@ti.com>
@@ -33,7 +33,6 @@
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
-#include <linux/platform_data/mailbox-omap.h>
 #include <linux/omap-mailbox.h>
 #include <linux/mailbox_controller.h>
 #include <linux/mailbox_client.h>
@@ -69,6 +68,10 @@
 #define MBOX_NR_REGS			(MBOX_REG_SIZE / sizeof(u32))
 #define OMAP4_MBOX_NR_REGS		(OMAP4_MBOX_REG_SIZE / sizeof(u32))
 
+/* Interrupt register configuration types */
+#define MBOX_INTR_CFG_TYPE1		(0)
+#define MBOX_INTR_CFG_TYPE2		(1)
+
 struct omap_mbox_fifo {
 	unsigned long msg;
 	unsigned long fifo_stat;
@@ -696,8 +699,6 @@ static int omap_mbox_probe(struct platform_device *pdev)
 	int ret;
 	struct mbox_chan *chnls;
 	struct omap_mbox **list, *mbox, *mboxblk;
-	struct omap_mbox_pdata *pdata = pdev->dev.platform_data;
-	struct omap_mbox_dev_info *info = NULL;
 	struct omap_mbox_fifo_info *finfo, *finfoblk;
 	struct omap_mbox_device *mdev;
 	struct omap_mbox_fifo *fifo;
@@ -710,36 +711,26 @@ static int omap_mbox_probe(struct platform_device *pdev)
 	u32 l;
 	int i;
 
-	if (!node && (!pdata || !pdata->info_cnt || !pdata->info)) {
-		pr_err("%s: platform not supported\n", __func__);
+	if (!node) {
+		pr_err("%s: only DT-based devices are supported\n", __func__);
 		return -ENODEV;
 	}
 
-	if (node) {
-		match = of_match_device(omap_mailbox_of_match, &pdev->dev);
-		if (!match)
-			return -ENODEV;
-		intr_type = (u32)match->data;
+	match = of_match_device(omap_mailbox_of_match, &pdev->dev);
+	if (!match)
+		return -ENODEV;
+	intr_type = (u32)match->data;
 
-		if (of_property_read_u32(node, "ti,mbox-num-users",
-					 &num_users))
-			return -ENODEV;
+	if (of_property_read_u32(node, "ti,mbox-num-users", &num_users))
+		return -ENODEV;
 
-		if (of_property_read_u32(node, "ti,mbox-num-fifos",
-					 &num_fifos))
-			return -ENODEV;
+	if (of_property_read_u32(node, "ti,mbox-num-fifos", &num_fifos))
+		return -ENODEV;
 
-		info_count = of_get_available_child_count(node);
-		if (!info_count) {
-			dev_err(&pdev->dev, "no available mbox devices found\n");
-			return -ENODEV;
-		}
-	} else { /* non-DT device creation */
-		info_count = pdata->info_cnt;
-		info = pdata->info;
-		intr_type = pdata->intr_type;
-		num_users = pdata->num_users;
-		num_fifos = pdata->num_fifos;
+	info_count = of_get_available_child_count(node);
+	if (!info_count) {
+		dev_err(&pdev->dev, "no available mbox devices found\n");
+		return -ENODEV;
 	}
 
 	finfoblk = devm_kzalloc(&pdev->dev, info_count * sizeof(*finfoblk),
@@ -750,38 +741,28 @@ static int omap_mbox_probe(struct platform_device *pdev)
 	finfo = finfoblk;
 	child = NULL;
 	for (i = 0; i < info_count; i++, finfo++) {
-		if (node) {
-			child = of_get_next_available_child(node, child);
-			ret = of_property_read_u32_array(child, "ti,mbox-tx",
-							 tmp, ARRAY_SIZE(tmp));
-			if (ret)
-				return ret;
-			finfo->tx_id = tmp[0];
-			finfo->tx_irq = tmp[1];
-			finfo->tx_usr = tmp[2];
-
-			ret = of_property_read_u32_array(child, "ti,mbox-rx",
-							 tmp, ARRAY_SIZE(tmp));
-			if (ret)
-				return ret;
-			finfo->rx_id = tmp[0];
-			finfo->rx_irq = tmp[1];
-			finfo->rx_usr = tmp[2];
-
-			finfo->name = child->name;
-
-			if (of_find_property(child, "ti,mbox-send-noirq", NULL))
-				finfo->send_no_irq = true;
-		} else {
-			finfo->tx_id = info->tx_id;
-			finfo->rx_id = info->rx_id;
-			finfo->tx_usr = info->usr_id;
-			finfo->tx_irq = info->irq_id;
-			finfo->rx_usr = info->usr_id;
-			finfo->rx_irq = info->irq_id;
-			finfo->name = info->name;
-			info++;
-		}
+		child = of_get_next_available_child(node, child);
+		ret = of_property_read_u32_array(child, "ti,mbox-tx", tmp,
+						 ARRAY_SIZE(tmp));
+		if (ret)
+			return ret;
+		finfo->tx_id = tmp[0];
+		finfo->tx_irq = tmp[1];
+		finfo->tx_usr = tmp[2];
+
+		ret = of_property_read_u32_array(child, "ti,mbox-rx", tmp,
+						 ARRAY_SIZE(tmp));
+		if (ret)
+			return ret;
+		finfo->rx_id = tmp[0];
+		finfo->rx_irq = tmp[1];
+		finfo->rx_usr = tmp[2];
+
+		finfo->name = child->name;
+
+		if (of_find_property(child, "ti,mbox-send-noirq", NULL))
+			finfo->send_no_irq = true;
+
 		if (finfo->tx_id >= num_fifos || finfo->rx_id >= num_fifos ||
 		    finfo->tx_usr >= num_users || finfo->rx_usr >= num_users)
 			return -EINVAL;
diff --git a/include/linux/platform_data/mailbox-omap.h b/include/linux/platform_data/mailbox-omap.h
deleted file mode 100644
index 4631dbb4255e..000000000000
--- a/include/linux/platform_data/mailbox-omap.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * mailbox-omap.h
- *
- * Copyright (C) 2013 Texas Instruments, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef _PLAT_MAILBOX_H
-#define _PLAT_MAILBOX_H
-
-/* Interrupt register configuration types */
-#define MBOX_INTR_CFG_TYPE1	(0)
-#define MBOX_INTR_CFG_TYPE2	(1)
-
-/**
- * struct omap_mbox_dev_info - OMAP mailbox device attribute info
- * @name:	name of the mailbox device
- * @tx_id:	mailbox queue id used for transmitting messages
- * @rx_id:	mailbox queue id on which messages are received
- * @irq_id:	irq identifier number to use from the hwmod data
- * @usr_id:	mailbox user id for identifying the interrupt into
- *			the MPU interrupt controller.
- */
-struct omap_mbox_dev_info {
-	const char *name;
-	u32 tx_id;
-	u32 rx_id;
-	u32 irq_id;
-	u32 usr_id;
-};
-
-/**
- * struct omap_mbox_pdata - OMAP mailbox platform data
- * @intr_type:	type of interrupt configuration registers used
-			while programming mailbox queue interrupts
- * @num_users:	number of users (processor devices) that the mailbox
- *			h/w block can interrupt
- * @num_fifos:	number of h/w fifos within the mailbox h/w block
- * @info_cnt:	number of mailbox devices for the platform
- * @info:	array of mailbox device attributes
- */
-struct omap_mbox_pdata {
-	u32 intr_type;
-	u32 num_users;
-	u32 num_fifos;
-	u32 info_cnt;
-	struct omap_mbox_dev_info *info;
-};
-
-#endif /* _PLAT_MAILBOX_H */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] mailbox/omap: use variable name for sizeof() operator
  2016-04-06 17:37 [PATCH 0/4] OMAP Mailbox legacy platform device support removal Suman Anna
  2016-04-06 17:37 ` [PATCH 1/4] mailbox/omap: drop legacy platform device support Suman Anna
@ 2016-04-06 17:37 ` Suman Anna
  2016-04-06 17:37 ` [PATCH 3/4] mailbox/omap: remove FSF mailing address paragraph Suman Anna
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Suman Anna @ 2016-04-06 17:37 UTC (permalink / raw)
  To: Jassi Brar; +Cc: linux-kernel, linux-omap, Suman Anna

Fix the code formatting to use the kernel preferred style
of using the actual variables to determize the size using
the sizeof() operator. This fixes the corresponding checkpatch
warning as well.

Signed-off-by: Suman Anna <s-anna@ti.com>
---
 drivers/mailbox/omap-mailbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c
index ea06072c7322..274db62ccbbe 100644
--- a/drivers/mailbox/omap-mailbox.c
+++ b/drivers/mailbox/omap-mailbox.c
@@ -384,7 +384,7 @@ static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox,
 	if (!work)
 		return NULL;
 
-	mq = kzalloc(sizeof(struct omap_mbox_queue), GFP_KERNEL);
+	mq = kzalloc(sizeof(*mq), GFP_KERNEL);
 	if (!mq)
 		return NULL;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] mailbox/omap: remove FSF mailing address paragraph
  2016-04-06 17:37 [PATCH 0/4] OMAP Mailbox legacy platform device support removal Suman Anna
  2016-04-06 17:37 ` [PATCH 1/4] mailbox/omap: drop legacy platform device support Suman Anna
  2016-04-06 17:37 ` [PATCH 2/4] mailbox/omap: use variable name for sizeof() operator Suman Anna
@ 2016-04-06 17:37 ` Suman Anna
  2016-04-06 17:37 ` [PATCH 4/4] mailbox/omap: add blank lines after declarations Suman Anna
  2016-04-26  4:55 ` [PATCH 0/4] OMAP Mailbox legacy platform device support removal Jassi Brar
  4 siblings, 0 replies; 7+ messages in thread
From: Suman Anna @ 2016-04-06 17:37 UTC (permalink / raw)
  To: Jassi Brar; +Cc: linux-kernel, linux-omap, Suman Anna

Remove the paragraph about writing to the Free Software
Foundation's mailing address from the GPL license header
as this address can change. This fixes the corresponding
checkpatch warning.

Signed-off-by: Suman Anna <s-anna@ti.com>
---
 drivers/mailbox/omap-mailbox.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c
index 274db62ccbbe..3ffdc7dbb09e 100644
--- a/drivers/mailbox/omap-mailbox.c
+++ b/drivers/mailbox/omap-mailbox.c
@@ -15,12 +15,6 @@
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
  */
 
 #include <linux/interrupt.h>
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] mailbox/omap: add blank lines after declarations
  2016-04-06 17:37 [PATCH 0/4] OMAP Mailbox legacy platform device support removal Suman Anna
                   ` (2 preceding siblings ...)
  2016-04-06 17:37 ` [PATCH 3/4] mailbox/omap: remove FSF mailing address paragraph Suman Anna
@ 2016-04-06 17:37 ` Suman Anna
  2016-04-26  4:55 ` [PATCH 0/4] OMAP Mailbox legacy platform device support removal Jassi Brar
  4 siblings, 0 replies; 7+ messages in thread
From: Suman Anna @ 2016-04-06 17:37 UTC (permalink / raw)
  To: Jassi Brar; +Cc: linux-kernel, linux-omap, Suman Anna

Fix couple of checkpatch warnings of the type,
"WARNING: Missing a blank line after declarations"

Also, fixed a warning about a space after a typecast
while at this.

Signed-off-by: Suman Anna <s-anna@ti.com>
---
 drivers/mailbox/omap-mailbox.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c
index 3ffdc7dbb09e..84cafc02e761 100644
--- a/drivers/mailbox/omap-mailbox.c
+++ b/drivers/mailbox/omap-mailbox.c
@@ -154,24 +154,28 @@ void mbox_write_reg(struct omap_mbox_device *mdev, u32 val, size_t ofs)
 static mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox)
 {
 	struct omap_mbox_fifo *fifo = &mbox->rx_fifo;
-	return (mbox_msg_t) mbox_read_reg(mbox->parent, fifo->msg);
+
+	return (mbox_msg_t)mbox_read_reg(mbox->parent, fifo->msg);
 }
 
 static void mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg)
 {
 	struct omap_mbox_fifo *fifo = &mbox->tx_fifo;
+
 	mbox_write_reg(mbox->parent, msg, fifo->msg);
 }
 
 static int mbox_fifo_empty(struct omap_mbox *mbox)
 {
 	struct omap_mbox_fifo *fifo = &mbox->rx_fifo;
+
 	return (mbox_read_reg(mbox->parent, fifo->msg_stat) == 0);
 }
 
 static int mbox_fifo_full(struct omap_mbox *mbox)
 {
 	struct omap_mbox_fifo *fifo = &mbox->tx_fifo;
+
 	return mbox_read_reg(mbox->parent, fifo->fifo_stat);
 }
 
@@ -522,6 +526,7 @@ static int omap_mbox_register(struct omap_mbox_device *mdev)
 	mboxes = mdev->mboxes;
 	for (i = 0; mboxes[i]; i++) {
 		struct omap_mbox *mbox = mboxes[i];
+
 		mbox->dev = device_create(&omap_mbox_class, mdev->dev,
 					0, mbox, "%s", mbox->name);
 		if (IS_ERR(mbox->dev)) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] OMAP Mailbox legacy platform device support removal
  2016-04-06 17:37 [PATCH 0/4] OMAP Mailbox legacy platform device support removal Suman Anna
                   ` (3 preceding siblings ...)
  2016-04-06 17:37 ` [PATCH 4/4] mailbox/omap: add blank lines after declarations Suman Anna
@ 2016-04-26  4:55 ` Jassi Brar
  2016-04-26 17:06   ` Suman Anna
  4 siblings, 1 reply; 7+ messages in thread
From: Jassi Brar @ 2016-04-26  4:55 UTC (permalink / raw)
  To: Suman Anna; +Cc: Linux Kernel Mailing List, linux-omap

On Wed, Apr 6, 2016 at 6:37 PM, Suman Anna <s-anna@ti.com> wrote:
> Hi Jassi,
>
> This series cleans up the OMAP Mailbox driver dropping the
> support for legacy non-DT platform devices. The infrastructure
> for creating any such devices has all been cleaned up from the
> mach-omap2 layers.
>
> The removal from the driver is accomplished in patch 1, while the
> remaining patches do some minor checkpatch fixes.
>
> Patches baselined on 4.6-rc2.
>
Applied this and the next patchset, with a trivial cleanup

- #define MBOX_INTR_CFG_TYPE1            (0)
- #define MBOX_INTR_CFG_TYPE2            (1)
+ #define MBOX_INTR_CFG_TYPE1            0
+ #define MBOX_INTR_CFG_TYPE2            1

Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] OMAP Mailbox legacy platform device support removal
  2016-04-26  4:55 ` [PATCH 0/4] OMAP Mailbox legacy platform device support removal Jassi Brar
@ 2016-04-26 17:06   ` Suman Anna
  0 siblings, 0 replies; 7+ messages in thread
From: Suman Anna @ 2016-04-26 17:06 UTC (permalink / raw)
  To: Jassi Brar; +Cc: Linux Kernel Mailing List, linux-omap

On 04/25/2016 11:55 PM, Jassi Brar wrote:
> On Wed, Apr 6, 2016 at 6:37 PM, Suman Anna <s-anna@ti.com> wrote:
>> Hi Jassi,
>>
>> This series cleans up the OMAP Mailbox driver dropping the
>> support for legacy non-DT platform devices. The infrastructure
>> for creating any such devices has all been cleaned up from the
>> mach-omap2 layers.
>>
>> The removal from the driver is accomplished in patch 1, while the
>> remaining patches do some minor checkpatch fixes.
>>
>> Patches baselined on 4.6-rc2.
>>
> Applied this and the next patchset, with a trivial cleanup
> 
> - #define MBOX_INTR_CFG_TYPE1            (0)
> - #define MBOX_INTR_CFG_TYPE2            (1)
> + #define MBOX_INTR_CFG_TYPE1            0
> + #define MBOX_INTR_CFG_TYPE2            1
> 
> Thanks.

Thanks Jassi.

regards
Suman

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-04-26 17:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-06 17:37 [PATCH 0/4] OMAP Mailbox legacy platform device support removal Suman Anna
2016-04-06 17:37 ` [PATCH 1/4] mailbox/omap: drop legacy platform device support Suman Anna
2016-04-06 17:37 ` [PATCH 2/4] mailbox/omap: use variable name for sizeof() operator Suman Anna
2016-04-06 17:37 ` [PATCH 3/4] mailbox/omap: remove FSF mailing address paragraph Suman Anna
2016-04-06 17:37 ` [PATCH 4/4] mailbox/omap: add blank lines after declarations Suman Anna
2016-04-26  4:55 ` [PATCH 0/4] OMAP Mailbox legacy platform device support removal Jassi Brar
2016-04-26 17:06   ` Suman Anna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).