devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
To: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Gary Bisson
	<gary.bisson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>,
	Grygorii Strashko
	<grygorii.strashko-l0cyMroinI0@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 1/2] pinctrl: core: Make dt_free_map optional
Date: Fri, 30 Dec 2016 10:37:31 -0800	[thread overview]
Message-ID: <20161230183732.5595-2-tony@atomide.com> (raw)
In-Reply-To: <20161230183732.5595-1-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>

If the pin controller driver is using devm_kzalloc, there may not be
anything to do for dt_free_map. Let's make it optional to avoid
unncessary boilerplate code.

Signed-off-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
---
 drivers/pinctrl/core.c       | 3 ---
 drivers/pinctrl/devicetree.c | 3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1913,9 +1913,6 @@ static int pinctrl_check_ops(struct pinctrl_dev *pctldev)
 	    !ops->get_group_name)
 		return -EINVAL;
 
-	if (ops->dt_node_to_map && !ops->dt_free_map)
-		return -EINVAL;
-
 	return 0;
 }
 
diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c
--- a/drivers/pinctrl/devicetree.c
+++ b/drivers/pinctrl/devicetree.c
@@ -42,7 +42,8 @@ static void dt_free_map(struct pinctrl_dev *pctldev,
 {
 	if (pctldev) {
 		const struct pinctrl_ops *ops = pctldev->desc->pctlops;
-		ops->dt_free_map(pctldev, map, num_maps);
+		if (ops->dt_free_map)
+			ops->dt_free_map(pctldev, map, num_maps);
 	} else {
 		/* There is no pctldev for PIN_MAP_TYPE_DUMMY_STATE */
 		kfree(map);
-- 
2.11.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-12-30 18:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-30 18:37 [PATCH 0/2] Add TI iodelay driver using #pinctrl-cells Tony Lindgren
     [not found] ` <20161230183732.5595-1-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-12-30 18:37   ` Tony Lindgren [this message]
     [not found]     ` <20161230183732.5595-2-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-09 18:41       ` [PATCH 1/2] pinctrl: core: Make dt_free_map optional Linus Walleij
2016-12-30 18:37 ` [PATCH 2/2] pinctrl: Introduce TI IOdelay configuration driver Tony Lindgren
2016-12-30 18:49   ` [PATCH] ARM: dts: Add dra7 iodelay configuration and use it for MMC Tony Lindgren
     [not found]     ` <20161230184914.GC3940-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-09 18:47       ` Linus Walleij
2017-02-14 18:51     ` Tony Lindgren
     [not found]       ` <20170214185120.GL21809-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-02-14 18:57         ` Nishanth Menon
     [not found]           ` <932aa035-27c9-0bb4-ffe2-81959aea6662-l0cyMroinI0@public.gmane.org>
2017-02-15 12:35             ` Kishon Vijay Abraham I
     [not found]               ` <58A44B02.10204-l0cyMroinI0@public.gmane.org>
2017-02-15 15:50                 ` Tony Lindgren
2017-02-16 13:58                   ` Kishon Vijay Abraham I
     [not found]   ` <20161230183732.5595-3-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-12-31 22:52     ` [PATCH 2/2] pinctrl: Introduce TI IOdelay configuration driver kbuild test robot
     [not found]       ` <201701010645.EBjk2p8Y%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-01-02 18:04         ` Tony Lindgren
2017-01-01  2:02     ` kbuild test robot
2017-01-02 22:12     ` Tony Lindgren
2017-01-04 13:32       ` Rob Herring
2017-01-04 15:38       ` Nishanth Menon
     [not found]         ` <63a8a1ec-343a-8c96-a0d2-21d81f7ad10e-l0cyMroinI0@public.gmane.org>
2017-01-04 16:05           ` Tony Lindgren
     [not found]             ` <20170104160511.GF25222-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-04 16:51               ` Nishanth Menon
     [not found]       ` <20170102221228.GH9325-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-04 17:57         ` Nishanth Menon
2017-01-05 18:50           ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2017-01-05 18:54 [PATCHv3 0/2] Add TI iodelay driver using #pinctrl-cells Tony Lindgren
     [not found] ` <20170105185414.27247-1-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-05 18:54   ` [PATCH 1/2] pinctrl: core: Make dt_free_map optional Tony Lindgren

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=20161230183732.5595-2-tony@atomide.com \
    --to=tony-4v6ys6ai5vpbdgjk7y7tuq@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=gary.bisson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org \
    --cc=grygorii.strashko-l0cyMroinI0@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=nm-l0cyMroinI0@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).