From patchwork Tue Sep 30 07:14:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 38124 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B58820549 for ; Tue, 30 Sep 2014 07:14:42 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id b6sf35809lbj.5 for ; Tue, 30 Sep 2014 00:14:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=BEayqI3Jwkx/S7YOjyOYqDVLBqPq04cPv957U3K/xMY=; b=aOK2hJFhhgbQk6tD/90jZ775yYyKpMu92IcwTio2xjaGW6ZYLjYhKu5nGQfiCSDnbr vTN0wCJKjecyU04qxXfwppRg95E+1kHVaY76HP7g6vXZi5nP8eDPPVrK/lvoJ6Nvjsnu SpKREPe7VKgdJi/Vm2xnwmwiFWsFaRnfaL/hTl/IFxmdGh+flneqVS4kXKKMdjuHXIyt /wfLj+9rGs0tlaVSAa6dZL2fx1HczJOCuVkiUjWm8VJ0U3Pdm4CDF1GmZyrhx+Hb8YeO fAgXaRMiCa+T24zjub3fAwFiUErGPM3E6nVE3rAwa7k44mEr2q8DehwEkdgqubvKpZlT tIhQ== X-Gm-Message-State: ALoCoQkpWYQ1McDEabdJx+0t+jM160/TmpvxH1+SYUGcKXH5LfPgbp4v+cgSPEePx+2qWk21WpkS X-Received: by 10.152.29.130 with SMTP id k2mr5762035lah.3.1412061281084; Tue, 30 Sep 2014 00:14:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.233 with SMTP id uh9ls2838lac.70.gmail; Tue, 30 Sep 2014 00:14:40 -0700 (PDT) X-Received: by 10.152.163.66 with SMTP id yg2mr44672676lab.38.1412061280516; Tue, 30 Sep 2014 00:14:40 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx.google.com with ESMTPS id am7si21289666lac.74.2014.09.30.00.14.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Sep 2014 00:14:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id f15so5765424lbj.25 for ; Tue, 30 Sep 2014 00:14:40 -0700 (PDT) X-Received: by 10.112.134.229 with SMTP id pn5mr16464530lbb.22.1412061280401; Tue, 30 Sep 2014 00:14:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp298869lbb; Tue, 30 Sep 2014 00:14:39 -0700 (PDT) X-Received: by 10.68.221.166 with SMTP id qf6mr68522389pbc.12.1412061278965; Tue, 30 Sep 2014 00:14:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jc4si26197064pbd.35.2014.09.30.00.14.37 for ; Tue, 30 Sep 2014 00:14:38 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752033AbaI3HOe (ORCPT + 27 others); Tue, 30 Sep 2014 03:14:34 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:42005 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488AbaI3HOb (ORCPT ); Tue, 30 Sep 2014 03:14:31 -0400 Received: by mail-we0-f175.google.com with SMTP id q59so3186229wes.6 for ; Tue, 30 Sep 2014 00:14:30 -0700 (PDT) X-Received: by 10.194.57.105 with SMTP id h9mr8904923wjq.116.1412061270765; Tue, 30 Sep 2014 00:14:30 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id v9sm18187211wjy.14.2014.09.30.00.14.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Sep 2014 00:14:29 -0700 (PDT) From: Linus Walleij To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linux-gpio@vger.kernel.org, Linus Walleij Subject: [PATCH 2/3] pinctrl: nomadik: use utils map free function Date: Tue, 30 Sep 2014 09:14:26 +0200 Message-Id: <1412061266-20790-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Stop brewing our own map free function and rely on the pinctrl utils helpers. Signed-off-by: Linus Walleij --- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index 9fe31daf9230..6c9667a44b7b 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -1339,17 +1339,6 @@ static void nmk_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, nmk_gpio_dbg_show_one(s, pctldev, chip, offset - chip->base, offset); } -static void nmk_pinctrl_dt_free_map(struct pinctrl_dev *pctldev, - struct pinctrl_map *map, unsigned num_maps) -{ - int i; - - for (i = 0; i < num_maps; i++) - if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN) - kfree(map[i].data.configs.configs); - kfree(map); -} - static int nmk_dt_add_map_mux(struct pinctrl_map **map, unsigned *reserved_maps, unsigned *num_maps, const char *group, const char *function) @@ -1581,7 +1570,7 @@ static int nmk_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, ret = nmk_pinctrl_dt_subnode_to_map(pctldev, np, map, &reserved_maps, num_maps); if (ret < 0) { - nmk_pinctrl_dt_free_map(pctldev, *map, *num_maps); + pinctrl_utils_dt_free_map(pctldev, *map, *num_maps); return ret; } } @@ -1595,7 +1584,7 @@ static const struct pinctrl_ops nmk_pinctrl_ops = { .get_group_pins = nmk_get_group_pins, .pin_dbg_show = nmk_pin_dbg_show, .dt_node_to_map = nmk_pinctrl_dt_node_to_map, - .dt_free_map = nmk_pinctrl_dt_free_map, + .dt_free_map = pinctrl_utils_dt_free_map, }; static int nmk_pmx_get_funcs_cnt(struct pinctrl_dev *pctldev)