Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp432373lqt; Thu, 6 Jun 2024 07:50:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJlennu1yexN0QiJtMP23iAcjz0skZheeFqoxgsEJTKwEUEcIGS2YsfMIXs81g8ymzleJgtYRoMatGeiR8XO1aAb3CeFR8HLLmaiuLBg== X-Google-Smtp-Source: AGHT+IEcEm1vIWHbHRHxqKkpbdZs9WQA/BljxpkjnbEFNiJBrKxuPLdj3ZAe7G+9DvoSkCPwuAiQ X-Received: by 2002:a05:620a:294f:b0:795:1cf4:7cf8 with SMTP id af79cd13be357-7952eeff132mr512040385a.0.1717685441063; Thu, 06 Jun 2024 07:50:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717685441; cv=pass; d=google.com; s=arc-20160816; b=lY+mkfRI+fT3vs5DzgkOfFhA40mTKYujtzw5KH/UQvb2JJBMFFDKk23xw1Bi18PPPt Nb3fx1i9cSyNZ40cTCGLrHyLMooZe94qdGrdaueVoEgHpnbhtz7zX51hnfRmcm7G3TY7 Y3wVH7ijQO4Q3lYGmyJBPisdupfHe8TenV63NWlcD8E7ji3zg3lxJBBBgsd3IIKvz6TL YnomPlL4h7yBGuRhHEXIQ/TP8leVmr3XwxudsoeP376a6EJc0+CPU0VQxS0L3uJsWrzz jKGoOTL1FdtE+NV2i3ZMUrtcntrJVzuRD4SGJHg4EnzPThCmpGnB+Vi+Abt3DiFESTDD FAxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=adPYuwzND43MGJ8XDbcG7/Wy5Ym6DF8sMplXI10tv3c=; fh=HaoYmXCSR7Mg24hgX/azLvbGIHjx712tFnbMrIt78pY=; b=a0So9qdMrBK2NRYiwFuCpw3j0kZ3iX2h7HduHdUhT7F1sL3RHYTNQxqMA5OS6sGJ/g I4wL2M0GuPvBfeYqlUtE6uCKJXr0eqTjaYQJwWH1qRDIoQIB8kJxs83LNBBrmZSDRc9D euQ62MDekRYxJZLN+mmk/PsBXY1Re8utdElzOhvvZaJ/fxRQJEuXj7Ftdb0bDXP/GPiV rqMqeaY8EvKV3ZIYQTZYUNiGiLg873+mtvqmTlsNWp1Pcqhhcud+xvLj1GfkjNTUu61t 9V4cCd/02NX7azejN3S0Tt2Q2sFeJpCBOxTpe6yVnOvNIefXfP/NWxSWUgBHjbcIfRgb tvoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U9uM23Hl; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204451-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204451-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-795331cad53si164696485a.347.2024.06.06.07.50.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:50:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204451-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U9uM23Hl; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204451-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204451-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C4B7E1C24247 for ; Thu, 6 Jun 2024 14:50:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE6A21A2C3E; Thu, 6 Jun 2024 14:24:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="U9uM23Hl" 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 42CDA197A7A 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=1717683874; cv=none; b=NbwpfuMR2hnXg36cocArJUc1YKCbbMkYgp6+wl3k5kxjKixNuRgJxmIN86dWlFRlpSFYUB++wK+QmFVxk5wTaOA/rf+Nr0bstnRIVtcb7tiusRjEMv/sENCaIF4KkhYQA1eLXovK3/JYOUw1/PJFXXT2AQ0TdoTjla4Y/f1YHOI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683874; c=relaxed/simple; bh=ZBbi+lp0LjKTZzWwECBjKHrcXcDJTSGheSra+uYGleE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LHCTzLxuElII5e/jZQM4eIphT6jmFxYfrYADGTpdJYNaP4p1nZOYNv1X+atLGpVPUiix9SLqMcOu9le3Gzq42e+nODB29ssiXYvJwwzX94eGyZVH7fv2A27cokGw3X5BsVCAYBiMPVOhPzDjPlYUoomdS6irKFnpiYIsudE6DEw= 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 Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-52b840cfecdso1211748e87.3 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=C9wzs02jOAdd+LBno7RG2sdYNAHY0Cs7vzIMkKWPCyMTkMv6wAWf6gPXocjUQ1RAbJ sMa+7YbLrbosC9A4VzwWmKj6zM4Qs85gxb0/p6sIeALJhdy18evipN+8gUVKD1MJESb+ 7gklIA2y1QX/qXIp0MTIZ9ufZ7KqwGcItP2lTVxl2D47ccAt4AcLrmOSP2CjDg5bBC1n kskkv98B77sVhqKnSJX1dekMUeD5Qq8FoWTcyLCUajZwo2mzpnajznQn+VIc6D868ewE /jBIQYCN7I5xyBzryNB/nfSN5yv1+YpcsjqBMKxy1TRjpFw9QT5fbaP0OZsQYvX63FRT /s8w== X-Forwarded-Encrypted: i=1; AJvYcCUdZ7hgbANDcK5GXoICfbDp8PG9jhklxFFE67TdJjTnQX5IFfQMy/5rrSeGnszrkbpCj4mI7gWEvesje/TfzBuptMo44gAkjuB4JFoH X-Gm-Message-State: AOJu0YwFAdgNBsZSqT81ill29Ufltxk0Wr9BEOwUnPbf9IUVP0ofCILD dTxcvvckRP/3SN9rfGdIvuoDP+6CX+IFzarY3RemHElrqalDU7tKMC75+rATEds= 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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; -- 2.43.0