From patchwork Thu Jun 6 14:24:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688556 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6538E19645C for ; Thu, 6 Jun 2024 14:24:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683871; cv=none; b=kCUWP/2RHHniKKyDIQAd7O3ByCfFec9OYsbsqzBOXK6QiEHmehdseV8zB7wbh716EhLr0oIeTrcQJdHzk6LB04DKVq4w8r2Z6j3eX4bOPoF25FGuTffp9YlpfzCexzFoUsBKvDWQ5oNySIj7ZPt8i36SBnPNoUL0dscc93Ewsk4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683871; c=relaxed/simple; bh=dxFGGhzrS7LrLExlJB0Xcypo/XjMKtA9vb1gGePZ7dE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Y0BXSb4wlQXtlpDWyk5Ddc+nkufkKJskcihLjB3R7XLPZFkqFkhH2zTb639irAszlBNzbXUOXXr1CdfzZaALnUbr8moh4XCFqrG4G3470kl53rgbszQcSZD0wWpSdu0zF7IHbdoa9Elb7YH3fBaPURkWy7Pb3yXWe9yjCSqcTWc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=qsrVF80r; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qsrVF80r" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5295eb47b48so1311781e87.1 for ; Thu, 06 Jun 2024 07:24:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717683868; x=1718288668; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=s0R2FTqs9h57UOEpdGtqZQ+WmWHV210ccwRY3/zwf0g=; b=qsrVF80rCPEFZznlSUlCbhZn1Z4VCAEV8jySdl9wNaHolJRwkEDIP7wIV0XjE9YIS+ CgQcTr6C+e60KKYRypTvWdqhEBO/0cwuOZg9OkeyjD9mao4wTyTVxZk2j+MBhA/YHoI3 bVEBpr6JfjNXED57BcQwiGLqAZXd7f2Yzv+R0YO0giATtA8//AVpuODKaL3ksgd1Lc9Y gu0Zbsf/liwc/kozAycb/HPT0d9xu4ZC2w6mMAW4rZPg+hr3tP8c7C3tSg8q9vKMHPX9 J5BcmLTuEKXcLAZsu6pOL9m2Plw5QT80cknHl1xtcOSIhVyqqrd8MdW/JetSv+QmhK4j QFMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717683868; x=1718288668; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s0R2FTqs9h57UOEpdGtqZQ+WmWHV210ccwRY3/zwf0g=; b=Wyt7WMx9LQsF4VSGo6sFx/Yz/4kj/vp3D3mDgF1qJwp5E5bZWYx+umLarhhrnYj+aU I+eX3NwGkMcs01PUkMUahwyLS3oF+jYxsvhh410orfXNfT1F7rzzqdX0kqPqgVhq0mKB nEpb9c1831UVCQz2H8ZQZ7hIyHKfBeBnc62LHXi0i9mctWDmwOuHUkvjvPO8T4s6QHR8 113s4GTdfJWfbdjhWfX/uvyGUdPnGnfM9j1gA3VqDJw/1tqNvNa7qu3kwOEbqCmz9wGi wdwZSIzlMhN+qW29ek3vt+zMw9e2yp7HkQwxMu3gqZCsBAIxBjX8G8qom4b436+ilzMF M53Q== X-Forwarded-Encrypted: i=1; AJvYcCXoFY7AxR7wC4MVL5bFjsejc3qNiQCZBn0bb0TnoO6pHZ5EkkDO0SOjTaggwGt2PJ2GWnVXB75V/YbgLsJAXWZc2zOVVw0o X-Gm-Message-State: AOJu0YydPt3E/fVwheZcsRPbgcijjTmQl7E3wS4je2GLkPE8EwiW9ym9 FSUtK1Q73IoC+oydr3uWjft6t+YOif7PAVptJzSgzE8qiMklGYwnda31l2SjV8E= X-Google-Smtp-Source: AGHT+IF2Y2cO7geMFPXXxqbIXWUwXl2dSb3X6DXNOt4MeEsT3SiqSkUR2bYkClLkKDNyX3YkIQLemA== X-Received: by 2002:ac2:4906:0:b0:52b:79a5:517a with SMTP id 2adb3069b0e04-52bab4e5283mr3281219e87.33.1717683867645; Thu, 06 Jun 2024 07:24:27 -0700 (PDT) Received: from krzk-bin.. ([110.93.11.116]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52bb423ceeasm211659e87.185.2024.06.06.07.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:24:27 -0700 (PDT) From: Krzysztof Kozlowski To: Marc Kleine-Budde , Vincent Mailhol , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Manivannan Sadhasivam , Thomas Kopp , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH net-next 1/3] can: hi311x: simplify with spi_get_device_match_data() Date: Thu, 6 Jun 2024 16:24:22 +0200 Message-ID: <20240606142424.129709-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Use spi_get_device_match_data() helper to simplify a bit the driver. Signed-off-by: Krzysztof Kozlowski --- drivers/net/can/spi/hi311x.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/can/spi/hi311x.c b/drivers/net/can/spi/hi311x.c index e1b8533a602e..5d2c80f05611 100644 --- a/drivers/net/can/spi/hi311x.c +++ b/drivers/net/can/spi/hi311x.c @@ -830,7 +830,6 @@ static int hi3110_can_probe(struct spi_device *spi) struct device *dev = &spi->dev; struct net_device *net; struct hi3110_priv *priv; - const void *match; struct clk *clk; u32 freq; int ret; @@ -874,11 +873,7 @@ static int hi3110_can_probe(struct spi_device *spi) CAN_CTRLMODE_LISTENONLY | CAN_CTRLMODE_BERR_REPORTING; - match = device_get_match_data(dev); - if (match) - priv->model = (enum hi3110_model)(uintptr_t)match; - else - priv->model = spi_get_device_id(spi)->driver_data; + priv->model = (enum hi3110_model)spi_get_device_match_data(spi); priv->net = net; priv->clk = clk; From patchwork Thu Jun 6 14:24:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688557 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42D3D199394 for ; Thu, 6 Jun 2024 14:24:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683872; cv=none; b=UisBwNL6zSxcXpPzdP+e7pgQetPFGOp7ykKhRHAE2B2Jv8EAC1aXQQFoVs2dXYjUwhlQK8QFfO+bYMGGS0qTdOZwOCBaPWSRwWhnTSxNUT218m1KyasI3NRO9qPcReMtCuoAjaoJ0MkVWJ8hFSCNx3pPubguBdZ+dplVWuBOMfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683872; c=relaxed/simple; bh=ZBbi+lp0LjKTZzWwECBjKHrcXcDJTSGheSra+uYGleE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I4TXXCzLvuERrgofIj4w9CWK8cFuW3WWlJiTjbmZatMP3RGOhe+8aSkvnOnN588nbIw1ictjnxkHAGcOaYkow4sJ41xSjhSUPJoRRdyJzjkisSBLbJTaM6jJTzDu0luJIX3VHXnhXCTWcnyJHBJDW7o+8qDYYhQUjO9wGLUgUuc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=U9uM23Hl; arc=none smtp.client-ip=209.85.167.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="U9uM23Hl" Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-52b8e0e98adso1562118e87.0 for ; Thu, 06 Jun 2024 07:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717683869; x=1718288669; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=adPYuwzND43MGJ8XDbcG7/Wy5Ym6DF8sMplXI10tv3c=; b=U9uM23HlvcqKtRBeUesYq/9U09qNrNO/Jiv0nT1spk1WF/ZY+3tgyeOd9YTWmNJwes +n/p9rU/zG/A/kcEXF6lnbRvZABK/7sfva20jkVOOcJzO+tcdpMZO6Ov4DQZIrfhPVKE RHlmuZteCqIUf7iy8754BU8o6pRbAUkAcnHvAqCHiQTC2y2LDtC20PNe9D/x8a4I0uSl WGIuDYYMVzHV0bJ8uR6dyk2iQQZ4d3Qj5CwNpJQwhJYwhBRP1gLBCN6Q1ExHoWd63cqh YZOvkHvIxsyqGSMZjr0iGNyxKCDlsTvm3QoufyckriipaVyI3jP5o5PEWfC9i1ABd5mq BpYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717683869; x=1718288669; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=adPYuwzND43MGJ8XDbcG7/Wy5Ym6DF8sMplXI10tv3c=; b=TGWaibq57gVaczDZARXW/AqyRR3qGs6cxUZQ/Mi7jPWDXnxU8JsczQQ60bQ6Fbk6ih w24Dx4EzGrBuwTWhWTBi8TGOVs66vl+Hohg75vsHHiVoCqCEcBTbdnWbMOEZtRt8nzSJ lQCtEMj/xNNNoT2C6E35QG4VcXU+YmC6Yr+Ahelu/bZiQNU9nzjsdIrbjULyAwU4cH+c lpTFzFJ8QA94py09VxfjVgukLuAmJk0ZaCcSFEG4ZGKg/5pU7mJhswDXtyGI+fRaBB+T Db8j9zzHItAr87yzdQ3gqpY7SRAMxlYoMhYfkGFtWWJ89zuMiTqlTKcY3usfCIYGcdKB a/vg== X-Forwarded-Encrypted: i=1; AJvYcCVXZ3hpykPvwJDByPBqtF901gV8QjXTiBTd2FigI6VBuroUYvH+yBYt5UX3koqX1ivWTjxm5Huzy8C/M2469Awdm5ESBeRw X-Gm-Message-State: AOJu0Yzw6eDQSw0aPpS143lJG7oAz39O70YeM0O2P8L3LBljTNBO7CHc tsqxw5g9h2Z7JTH0Y69H9LNXKzBuWFCaeZRykGtdzqD5BcgKH9aWsacsbu3mdL0= X-Google-Smtp-Source: AGHT+IEq71kXnNrBuSLPtc6t7FA3EOuDZXOrq5ZDO002bnc0f5Xwz0UNijcj7UFoFYFcYsbxNeK+xg== X-Received: by 2002:a05:6512:3d0d:b0:529:bc99:1cd8 with SMTP id 2adb3069b0e04-52bab509406mr4685409e87.59.1717683869546; Thu, 06 Jun 2024 07:24:29 -0700 (PDT) Received: from krzk-bin.. ([110.93.11.116]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52bb423ceeasm211659e87.185.2024.06.06.07.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:24:28 -0700 (PDT) From: Krzysztof Kozlowski To: Marc Kleine-Budde , Vincent Mailhol , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Manivannan Sadhasivam , Thomas Kopp , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH net-next 2/3] can: mcp251x: simplify with spi_get_device_match_data() Date: Thu, 6 Jun 2024 16:24:23 +0200 Message-ID: <20240606142424.129709-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240606142424.129709-1-krzysztof.kozlowski@linaro.org> References: <20240606142424.129709-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Use spi_get_device_match_data() helper to simplify a bit the driver. Signed-off-by: Krzysztof Kozlowski --- drivers/net/can/spi/mcp251x.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c index 79c4bab5f724..85998b4b08c3 100644 --- a/drivers/net/can/spi/mcp251x.c +++ b/drivers/net/can/spi/mcp251x.c @@ -1301,7 +1301,6 @@ MODULE_DEVICE_TABLE(spi, mcp251x_id_table); static int mcp251x_can_probe(struct spi_device *spi) { - const void *match = device_get_match_data(&spi->dev); struct net_device *net; struct mcp251x_priv *priv; struct clk *clk; @@ -1339,10 +1338,7 @@ static int mcp251x_can_probe(struct spi_device *spi) priv->can.clock.freq = freq / 2; priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LOOPBACK | CAN_CTRLMODE_LISTENONLY; - if (match) - priv->model = (enum mcp251x_model)(uintptr_t)match; - else - priv->model = spi_get_device_id(spi)->driver_data; + priv->model = (enum mcp251x_model)spi_get_device_match_data(spi); priv->net = net; priv->clk = clk; From patchwork Thu Jun 6 14:24:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688558 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81A631A2C2A for ; Thu, 6 Jun 2024 14:24:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683875; cv=none; b=Nada5dhypzkcBdUV/oE6YX/4jTMrWeUEEhEnDUUjpbFwXeQy8jTkxYbU7ME6cHbJRLPTt+rJdIMR3uawNR/vLypwbsLxKYa8SrySPQe73pj9JVyiN5gg6paZqM6j4CC31csBB04kwK4hbiyqjEVZyuMtGmKHpedtzFZ/Bcics3s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683875; c=relaxed/simple; bh=8XJvY4PRNd7QP5IlcghDRm7uf8FuIIF+wmBZT8DMjQo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OVb50F44/Dhle8QvyGymHWEWyWsBJb3dtufVrYf4i2vpw8TCe2oFaMDWDNUwEX/9Ti1E1YqwlyqGITPaBbbiZdsEd1HZqQ0eRVMaitvUAgGnn7gC6XjwcsZzlrCNZbY4Wtj9fsoQ0Y5QDv1Iasg44cED0/yqPakLJV0McR13WIs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=WeROrlgf; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="WeROrlgf" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-52b9d062526so1181067e87.3 for ; Thu, 06 Jun 2024 07:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717683872; x=1718288672; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=++6vpzo3dEirc2BXnRm0i3mFbJVPl95CbYYtfzrVJSQ=; b=WeROrlgfNQ1p0/j3NdlyeOT/+NO75Z1fur4SfX8sst39SBCzDJcHmKeKIxhpsn8SI+ currbqjo+DETlrHvAD+JuWpMLoTzVbIhHluRjtNeJ8OV9iBNEekCrXBNvR97GspzHPZ1 nffqEIjyRJuRRdKvOyIOLBuM3LMnCPRRz3mda8ObD/kJL4jzLKlR2kkYtcSnm6XG1SbL eFUaOZ3H2KYiRvg1EOs3+e2GznVMLEIDzu/Bl68Vee9O+s/n3rq/Ar0JtJf68+DyZgsq TTJ58EQFkFRihRSufULY9iRXzTre4Qssh/sJTTmxf5/kJvRkvq0AQJQhtBKC+0F4sxED EtPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717683872; x=1718288672; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=++6vpzo3dEirc2BXnRm0i3mFbJVPl95CbYYtfzrVJSQ=; b=Rsw/AMvnLvyjHz9GcwitWWiiKYdSdR2qDOG+Lo7b19YoH6udufCL1WvdPvuS5D+ASb DR1hRqwHLv95fIByHf6rz6UYMx6xVBwaPRXhiKDk1P5KbdmlEqKc1hmrAinaX3nKCEWn Z9Tf6B5XWaXCD6LHbud5HOaAaUubtPeZTn8cgPXmEi7hQgeTXEhX/lyAVPstc4uc6R14 790CD+HOy+ijpNpEg/+nisqj+v5M0n86rfuzQbIAfQtE5fSiQFRv5/KbWmNstnMCo0iC zp4aHsyCIOKDqvoVDutIbWyk2EuANMNzyhhZbAeRAUq7tQ6Y+BzlTqh/lf5YQ0j63VmI OSrg== X-Forwarded-Encrypted: i=1; AJvYcCXr6YmMh9O7eM2T084uHnNxttHYBG7oatijwhg34VYfCWeMdkkPHVuuT3+X8V1wO4f254CwT3S2Pk6kKzjiITBSsLNwotdh X-Gm-Message-State: AOJu0YzG6+xpVL2iHvNC2xwQVUqczhRuWaMN9izJypWVbs2fonYlGK60 IwZ55bkG/LIOEykp6g5gYqcicgeqnxIQiT9l0eXwe/NEm7lMVjM5YIocavvohK4= X-Google-Smtp-Source: AGHT+IGK6NHwjN3jn4VsJlrqvbN9hjMoiszVr84okdXBzSyf4bSyTjksFWYG+VZCJ382BSeLaVQeGw== X-Received: by 2002:a05:6512:2035:b0:529:b609:fa0c with SMTP id 2adb3069b0e04-52bab50b666mr2809751e87.67.1717683871828; Thu, 06 Jun 2024 07:24:31 -0700 (PDT) Received: from krzk-bin.. ([110.93.11.116]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52bb423ceeasm211659e87.185.2024.06.06.07.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:24:30 -0700 (PDT) From: Krzysztof Kozlowski To: Marc Kleine-Budde , Vincent Mailhol , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Manivannan Sadhasivam , Thomas Kopp , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH net-next 3/3] can: mcp251xfd: simplify with spi_get_device_match_data() Date: Thu, 6 Jun 2024 16:24:24 +0200 Message-ID: <20240606142424.129709-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240606142424.129709-1-krzysztof.kozlowski@linaro.org> References: <20240606142424.129709-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Use spi_get_device_match_data() helper to simplify a bit the driver. Signed-off-by: Krzysztof Kozlowski --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c index 1d9057dc44f2..4b7e08e8ed56 100644 --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c @@ -1989,7 +1989,6 @@ MODULE_DEVICE_TABLE(spi, mcp251xfd_id_table); static int mcp251xfd_probe(struct spi_device *spi) { - const void *match; struct net_device *ndev; struct mcp251xfd_priv *priv; struct gpio_desc *rx_int; @@ -2081,13 +2080,7 @@ static int mcp251xfd_probe(struct spi_device *spi) priv->pll_enable = pll_enable; priv->reg_vdd = reg_vdd; priv->reg_xceiver = reg_xceiver; - - match = device_get_match_data(&spi->dev); - if (match) - priv->devtype_data = *(struct mcp251xfd_devtype_data *)match; - else - priv->devtype_data = *(struct mcp251xfd_devtype_data *) - spi_get_device_id(spi)->driver_data; + priv->devtype_data = *(struct mcp251xfd_devtype_data *)spi_get_device_match_data(spi); /* Errata Reference: * mcp2517fd: DS80000792C 5., mcp2518fd: DS80000789C 4.