Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbeABN66 (ORCPT + 1 other); Tue, 2 Jan 2018 08:58:58 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:46910 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753490AbeABN4x (ORCPT ); Tue, 2 Jan 2018 08:56:53 -0500 X-IronPort-AV: E=Sophos;i="5.45,497,1508796000"; d="scan'208";a="307399611" From: Julia Lawall To: Linus Walleij Cc: kernel-janitors@vger.kernel.org, Chen-Yu Tsai , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/12] pinctrl: axp209: account for const type of of_device_id.data Date: Tue, 2 Jan 2018 14:28:04 +0100 Message-Id: <1514899688-27844-9-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1514899688-27844-1-git-send-email-Julia.Lawall@lip6.fr> References: <1514899688-27844-1-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: The return value of of_device_get_match_data has type const void *. The desc field of the pctl structure also has a const type, so there is no need for the const-discarding cast between them. Done using Coccinelle. Signed-off-by: Julia Lawall --- drivers/pinctrl/pinctrl-axp209.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -u -p a/drivers/pinctrl/pinctrl-axp209.c b/drivers/pinctrl/pinctrl-axp209.c --- a/drivers/pinctrl/pinctrl-axp209.c +++ b/drivers/pinctrl/pinctrl-axp209.c @@ -414,7 +414,7 @@ static int axp20x_pctl_probe(struct plat pctl->chip.direction_input = axp20x_gpio_input; pctl->chip.direction_output = axp20x_gpio_output; - pctl->desc = (struct axp20x_pctrl_desc *)of_device_get_match_data(dev); + pctl->desc = of_device_get_match_data(dev); pctl->chip.ngpio = pctl->desc->npins;