From patchwork Sun Mar 3 15:01:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 224553 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3A3D22C0308 for ; Mon, 4 Mar 2013 02:19:39 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UCASC-0000Sj-TQ; Sun, 03 Mar 2013 15:03:56 +0000 Received: from mail-pa0-f49.google.com ([209.85.220.49]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UCASA-0000Q1-Dr for linux-arm-kernel@lists.infradead.org; Sun, 03 Mar 2013 15:03:55 +0000 Received: by mail-pa0-f49.google.com with SMTP id kp6so2676395pab.36 for ; Sun, 03 Mar 2013 07:01:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding:x-gm-message-state; bh=FEiwOtNfTZm78fGS/ijDEG/5o/5h+7DxevZMy6dbdRw=; b=FJGRO/qjIRo5uEnrBbNH+NR0fVn98zrl+uXI00eHJq89qorEaX8XbzaJdCmC6G9agx bED3QPUEpLjSmCJlQjM7vYTGJwiIOhPQxvaScKrvp/wsKhBhLnqRohcjnztMNFUD4/Pa 9HJSJQP8m/QN3pIY488rVzZKttT866mK/kXF4hyS7WFYK1iM8V9ao2/RTqelk63G2uTP jMz4WauMRV+zrIVc1Iz3bNCGrhybLWRewOt1PSXFDyIneNOJjgzyv8AGOG1bL6FH/Fhu ZuFe7rvWy9WzD21xQudj8gI4BLT/IFueKLfUTTP9/TPZRzuQ0vBMsguYICXPvAi36SX/ bDjA== X-Received: by 10.66.25.105 with SMTP id b9mr27659399pag.45.1362322911553; Sun, 03 Mar 2013 07:01:51 -0800 (PST) Received: from haojian-E6230.solutionip.com ([118.143.64.130]) by mx.google.com with ESMTPS id z8sm7940742pbt.39.2013.03.03.07.01.48 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Mar 2013 07:01:50 -0800 (PST) From: Haojian Zhuang To: linus.walleij@linaro.org, tony@atomide.com, linux-arm-kernel@lists.infradead.org, fengguang.wu@intel.com Subject: [PATCH] pinctrl: single: avoid to set read only object Date: Sun, 3 Mar 2013 23:01:44 +0800 Message-Id: <1362322904-19570-1-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkloL/QLXI784J3KXbUzflKT88w0SGxXMREIOXw05bNP5bIMVm6gyO5tsNQodeIgjUBMrsu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130303_100354_557633_B104BD54 X-CRM114-Status: GOOD ( 11.92 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Haojian Zhuang , patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org drivers/pinctrl/pinctrl-single.c:1441:3: error: assignment of member ‘is_generic’ in read-only object make[2]: *** [drivers/pinctrl/pinctrl-single.o] Error 1 Since pcs_pinconf_ops is changed to read only structure, probe() function can't set is_generic variable any more. So append new pcs_pinconf_generic_ops. Signed-off-by: Haojian Zhuang Acked-by: Tony Lindgren --- drivers/pinctrl/pinctrl-single.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 4cdcf85..c80ffa8 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -734,6 +734,18 @@ static const struct pinconf_ops pcs_pinconf_ops = { .pin_config_dbg_show = pcs_pinconf_dbg_show, .pin_config_group_dbg_show = pcs_pinconf_group_dbg_show, .pin_config_config_dbg_show = pcs_pinconf_config_dbg_show, + .is_generic = false, +}; + +static const struct pinconf_ops pcs_pinconf_generic_ops = { + .pin_config_get = pcs_pinconf_get, + .pin_config_set = pcs_pinconf_set, + .pin_config_group_get = pcs_pinconf_group_get, + .pin_config_group_set = pcs_pinconf_group_set, + .pin_config_dbg_show = pcs_pinconf_dbg_show, + .pin_config_group_dbg_show = pcs_pinconf_group_dbg_show, + .pin_config_config_dbg_show = pcs_pinconf_config_dbg_show, + .is_generic = true, }; /** @@ -1435,10 +1447,8 @@ static int pcs_probe(struct platform_device *pdev) pcs->desc.name = DRIVER_NAME; pcs->desc.pctlops = &pcs_pinctrl_ops; pcs->desc.pmxops = &pcs_pinmux_ops; - pcs->desc.confops = &pcs_pinconf_ops; + pcs->desc.confops = match->data; pcs->desc.owner = THIS_MODULE; - if (match->data) - pcs_pinconf_ops.is_generic = true; ret = pcs_allocate_pin_table(pcs); if (ret < 0) @@ -1479,9 +1489,14 @@ static int pcs_remove(struct platform_device *pdev) } static struct of_device_id pcs_of_match[] = { - { .compatible = "pinctrl-single", .data = (void *)false }, - { .compatible = "pinconf-single", .data = (void *)true }, - { }, + { + .compatible = "pinctrl-single", + .data = (void *)&pcs_pinconf_ops, + }, { + .compatible = "pinconf-single", + .data = (void *)&pcs_pinconf_generic_ops, + }, { + }, }; MODULE_DEVICE_TABLE(of, pcs_of_match);