Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp153335lqc; Thu, 29 Feb 2024 13:07:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUzwQtXrwjTxNA0ZzriQM6UctWOfL3XAJYT234moybP7qZ5CP/g6Xd0+lTpucEDj22QvCgWpLAlg/7T7G3Tz18e8yWOes/5roGmEZ5axw== X-Google-Smtp-Source: AGHT+IHMPVgZRccF2TaWpzI9UFRSOuoAPP6MZ1pFvA0rT9u5yL8JUxm1Z7IOXE/YwxN7GVS7uJ8T X-Received: by 2002:a17:906:2f88:b0:a44:eb5:dd4b with SMTP id w8-20020a1709062f8800b00a440eb5dd4bmr86459eji.29.1709240822799; Thu, 29 Feb 2024 13:07:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709240822; cv=pass; d=google.com; s=arc-20160816; b=jvKNArOFntNxh40gQyf2SnC/FlUe8KuDiQ0BYfWSEPEhLA+udLvXDFcM5Oac4fB/LN VNn8FMr8QZxfNKHFlqzgUf8BFfHiRGG8+4SONiduM6+uBTUq4ErWWSzMO1Ozm4LDy2PR WlNrNn2LWD0p/LxNFvG1xQtFCy2o1+CoE09NL/5bDGHrl6LzNlUkhB1vWZDObE+Bb5Gc O/8uRmy3v0jusSyLhC/V4auttp/836Cpfe/rdDpajrZR1FPzFvUWisbkivIQ8Ja/v59h MVXwsQwEXCNpeelCojzRJWgCHJWH6gIKxD6tzsUcegEd8NLw9WJOl2JSnQPp66kKLfvn 2TAQ== 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=3K7f3RiTowa/EAhWLKI1GEo5jRAquYP1bOnRd1hO3Z4=; fh=VCu5+UGNgm8L1odrNYNIlAHWdufyqnxcBdig2Cdsf8c=; b=edNgjrUNwTKipVI7o0dgk97rMA8Hj4zkvoABFPI/rQm/DohEWbgOu0mbePDwV+lPkh DgbJMQ7mkYsDOmU5cGe3tpyeD7ALS3P+JvqAA8qkMQzA4fSj/29wq0S57nl4KRWha+Yp uCvmjXYPUO74N4zI8rgwVISaBkcdWfPuPPWz8B5H0/80BqCIRN6Z3TF+GVgz1jYZoIdO STBVq8CXC1f6CDlSeAIQYOLkYxOMPNCA1IpTmZ+mRKReA10nONu3vx9fOla0hVspzPah nY4O9RjUSRY2MjYQrq33eVWf7BWgAYCeehQ06alb0hBHIyHAED9c9WLUmgfrQTueURiC W9Aw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UvrbEA5i; 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-87537-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87537-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id hr20-20020a1709073f9400b00a4448562aa9si774865ejc.712.2024.02.29.13.07.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 13:07:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87537-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UvrbEA5i; 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-87537-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87537-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 881F31F21B09 for ; Thu, 29 Feb 2024 21:07:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C77EC145658; Thu, 29 Feb 2024 20:56:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UvrbEA5i" Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (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 E9F46145651 for ; Thu, 29 Feb 2024 20:56:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709240165; cv=none; b=etW5spyna7o19qqgWM3iakHs2IGP7MFsvy55IhX4QEAI43uwIDIzHqybZukeH1ELFnJ51iwfRrq9jk2pGzDVQYOOywZCBu9BYgKDk2qz7CMmls/OsdYo/xkndTkmGmiT/93Dgi4ylKAaHMgxtMisI8ihghhGeRCKrzAlAuCq5aA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709240165; c=relaxed/simple; bh=58ZSVqSazsVEHoU8qFXXAJJ94ldiaiahFmGNCpA1b2A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=apV0Q6oCgqfuIE50Kte4ES+vhtcaDMHOxPIcm4/1RLyEl/pyVtp0jSh/TngXnrUIXKFV4LHyPICyJKSGFB5mI4Amt4YgwcLQerdi+LliXa7S5fmUqgTeejNX6LUfsrPSFIhmUZBmbUcRiQkHrNSzYw06k/xCyxZ9F4zXKtfW5Bg= 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=UvrbEA5i; arc=none smtp.client-ip=209.85.166.173 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-il1-f173.google.com with SMTP id e9e14a558f8ab-36540b9885cso6289685ab.1 for ; Thu, 29 Feb 2024 12:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709240161; x=1709844961; 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=3K7f3RiTowa/EAhWLKI1GEo5jRAquYP1bOnRd1hO3Z4=; b=UvrbEA5iEz7Z3nDmxZ/U1S1OUpBy/DhhvQn1WpBgSeeT/WHxJR+FQaBcOFVgC6x53K QxblbfmMqkaNlXhj6ngPZY+Prt5ziVS5WmvvpVZPiS3aNnsf9mYKSsPKJesFJcxMVARr BzuxAYR2ueM2l+SvmiQN44hadgfENG1JZHGOEvx0JYnxo1tjBF9HqAzeZFGwi2O1odld 8iyJsjLoJWl4We3wGCjbjmIeaclZ8ZHZUeeWj+qMxG04IQwRUDlhqpVvLr2pvY+disrX Fy0EQthAtfXb11KWKwqkTnKB6ugcp5JrhB2rgYcSrLrPqk2xEc/lSzTErTSawkoil24x BWCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709240161; x=1709844961; 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=3K7f3RiTowa/EAhWLKI1GEo5jRAquYP1bOnRd1hO3Z4=; b=QcLVc3B7jd/3uLIq3W/qpi3zs5Q4abZ8KKxRzzS5YAkcoFHTftoLu52tmYHbZdkh1y eqxOeeLDwctbpLDzCKdy2fj6Vq9KhRk+qegvfphDHjjLtgQVbDXhZpcayakiwaSrZNn0 92Vdp02RwuKVh/sVu/8fqH5yhhih8QHTTzgJP3N+hMxRkiU4JHy4Upgcr0eEmf+C0OZl HOKtBH1DoUL9yorM5Cv+foilhNhuQYhFxonYbeNuYCBf8XDcUz9qXH32YlBRa5R6eA/A qCiym/MNxd6BrIZHpl52r/K3zjp8n9BMWUC3TMoUGD2veuy62Pqp1JUM/zyqeNwD2o65 23jw== X-Forwarded-Encrypted: i=1; AJvYcCXAb4gLi8+JjEHmHrbHlwCDz16c4ajs0LhbwDoLOMP2oQTpt9WzeTntGNSByHBSU8go8IOnqB1GNR8pU/m29S+NR9PgR0iH6HSjPy5F X-Gm-Message-State: AOJu0Yz9D5JsmD2cFkbEQEm2B0D0v7rZPHH1IxsRcbJ+W5y88cQ6AzUz 0DWZAn9cNz0MdsbuBvoCTBf9zm3sewPM4osVjK19ZRX8UNZZsljNg7HhM8LTFZ+j1+KaM6jfhnK 7 X-Received: by 2002:a05:6e02:12c3:b0:365:3a69:1e20 with SMTP id i3-20020a056e0212c300b003653a691e20mr47922ilm.3.1709240161169; Thu, 29 Feb 2024 12:56:01 -0800 (PST) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id h14-20020a056e020d4e00b003658fbcf55dsm521551ilj.72.2024.02.29.12.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 12:56:00 -0800 (PST) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/7] net: ipa: change ipa_interrupt_config() prototype Date: Thu, 29 Feb 2024 14:55:48 -0600 Message-Id: <20240229205554.86762-2-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240229205554.86762-1-elder@linaro.org> References: <20240229205554.86762-1-elder@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 Change the return type of ipa_interrupt_config() to be an error code rather than an IPA interrupt structure pointer, and assign the the pointer within that function. Change ipa_interrupt_deconfig() to take the IPA pointer as argument and have it invalidate the ipa->interrupt pointer. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_interrupt.c | 15 ++++++++++----- drivers/net/ipa/ipa_interrupt.h | 10 +++++----- drivers/net/ipa/ipa_main.c | 13 ++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index 4d80bf77a5323..a298d922dd871 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -236,7 +236,7 @@ void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt) } /* Configure the IPA interrupt framework */ -struct ipa_interrupt *ipa_interrupt_config(struct ipa *ipa) +int ipa_interrupt_config(struct ipa *ipa) { struct device *dev = &ipa->pdev->dev; struct ipa_interrupt *interrupt; @@ -254,10 +254,12 @@ struct ipa_interrupt *ipa_interrupt_config(struct ipa *ipa) interrupt = kzalloc(sizeof(*interrupt), GFP_KERNEL); if (!interrupt) - return ERR_PTR(-ENOMEM); + return -ENOMEM; interrupt->ipa = ipa; interrupt->irq = irq; + ipa->interrupt = interrupt; + /* Start with all IPA interrupts disabled */ reg = ipa_reg(ipa, IPA_IRQ_EN); iowrite32(0, ipa->reg_virt + reg_offset(reg)); @@ -282,13 +284,16 @@ struct ipa_interrupt *ipa_interrupt_config(struct ipa *ipa) err_kfree: kfree(interrupt); - return ERR_PTR(ret); + return ret; } /* Inverse of ipa_interrupt_config() */ -void ipa_interrupt_deconfig(struct ipa_interrupt *interrupt) +void ipa_interrupt_deconfig(struct ipa *ipa) { - struct device *dev = &interrupt->ipa->pdev->dev; + struct ipa_interrupt *interrupt = ipa->interrupt; + struct device *dev = &ipa->pdev->dev; + + ipa->interrupt = NULL; dev_pm_clear_wake_irq(dev); free_irq(interrupt->irq, interrupt); diff --git a/drivers/net/ipa/ipa_interrupt.h b/drivers/net/ipa/ipa_interrupt.h index 53e1b71685c75..1947654e3e360 100644 --- a/drivers/net/ipa/ipa_interrupt.h +++ b/drivers/net/ipa/ipa_interrupt.h @@ -76,17 +76,17 @@ void ipa_interrupt_irq_enable(struct ipa *ipa); void ipa_interrupt_irq_disable(struct ipa *ipa); /** - * ipa_interrupt_config() - Configure the IPA interrupt framework + * ipa_interrupt_config() - Configure IPA interrupts * @ipa: IPA pointer * - * Return: Pointer to IPA SMP2P info, or a pointer-coded error + * Return: 0 if successful, or a negative error code */ -struct ipa_interrupt *ipa_interrupt_config(struct ipa *ipa); +int ipa_interrupt_config(struct ipa *ipa); /** * ipa_interrupt_deconfig() - Inverse of ipa_interrupt_config() - * @interrupt: IPA interrupt structure + * @ipa: IPA pointer */ -void ipa_interrupt_deconfig(struct ipa_interrupt *interrupt); +void ipa_interrupt_deconfig(struct ipa *ipa); #endif /* _IPA_INTERRUPT_H_ */ diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 00475fd7a2054..0c6e6719d99e3 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -542,12 +542,9 @@ static int ipa_config(struct ipa *ipa, const struct ipa_data *data) if (ret) goto err_hardware_deconfig; - ipa->interrupt = ipa_interrupt_config(ipa); - if (IS_ERR(ipa->interrupt)) { - ret = PTR_ERR(ipa->interrupt); - ipa->interrupt = NULL; + ret = ipa_interrupt_config(ipa); + if (ret) goto err_mem_deconfig; - } ipa_uc_config(ipa); @@ -572,8 +569,7 @@ static int ipa_config(struct ipa *ipa, const struct ipa_data *data) ipa_endpoint_deconfig(ipa); err_uc_deconfig: ipa_uc_deconfig(ipa); - ipa_interrupt_deconfig(ipa->interrupt); - ipa->interrupt = NULL; + ipa_interrupt_deconfig(ipa); err_mem_deconfig: ipa_mem_deconfig(ipa); err_hardware_deconfig: @@ -591,8 +587,7 @@ static void ipa_deconfig(struct ipa *ipa) ipa_modem_deconfig(ipa); ipa_endpoint_deconfig(ipa); ipa_uc_deconfig(ipa); - ipa_interrupt_deconfig(ipa->interrupt); - ipa->interrupt = NULL; + ipa_interrupt_deconfig(ipa); ipa_mem_deconfig(ipa); ipa_hardware_deconfig(ipa); } -- 2.40.1