From patchwork Mon Oct 7 15:03:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13824883 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 752AD1D8A09; Mon, 7 Oct 2024 15:04:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313488; cv=none; b=YArSBYi7+pig4G3Og8tT+2NBzsVSAEpy9xx7xiZ1XUc8JVons9xZ1UGpIJE3/j914BppM6gVsBKbbYHfYVq2I4Ad1R/AhvMt9hgYGxbdz90JKzCszyVY5tTgihMLxLT350m/f4F4SCSSWni7RrxYHZlRVRyc3hn+gKgfweOdJnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313488; c=relaxed/simple; bh=d24Hu2RJOoM40sVPPDRXUIVnKIl8dW596VcFY5jbpTE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YNCq358VpYUb89ucK86MjvP+ekiUqTGdIJnZ7mf40ILX3UbMEzGzRhAgLOBbunI9rZXWQUqbv1KG01tM50TCuETcXD98qw9jNczT5Ooie5nbU+yigG3am1Aod88YfsXOd3fOn0TfRg/2XwWJ8LMeEH05UudGliTpUfYBRGNcnTM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Yl6pZo6W; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Yl6pZo6W" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728313488; x=1759849488; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d24Hu2RJOoM40sVPPDRXUIVnKIl8dW596VcFY5jbpTE=; b=Yl6pZo6W8+StlTvz7iQIIJW303bVBCXFcJArqMJpshf4oFQ02cuRmSVv onJSIMB0P9fCrXVWemBhqy0+voY1eSJQNmhUpWoWKoe8C61twxpTkRdgA i+pV81/wpNW9sGnz1bLhHBwC7S2gOpZpDG/xrxieI8m4uZrK2X/xX7x8B Gix8RD9jVXyKyGsFmhZqbPRpUVwPIDwPGW8n62JPhYay2C4/HqCc7Lt2+ VmFf9aPM+nLufUfDMs5gX+cYFW/Z7IwyOhmmf9evIbaBgZQkRysqDZlvP RrJ9fovhJxVKucLAAVmSt5DiceuHwbNKIYc/+1x4vFDNBhd6HaHXLFiRY A==; X-CSE-ConnectionGUID: T6D2K7RPSZG0uBlkoCXZrA== X-CSE-MsgGUID: 0NrZLHG9TDy9Q/lCyvgPeQ== X-IronPort-AV: E=McAfee;i="6700,10204,11218"; a="27559144" X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="27559144" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2024 08:04:45 -0700 X-CSE-ConnectionGUID: IZsAPazmTzyPIPiev799Pw== X-CSE-MsgGUID: PoEoj8fQRWKIt4zqY8rZVw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="106342482" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa002.jf.intel.com with ESMTP; 07 Oct 2024 08:04:44 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id DC58227C; Mon, 07 Oct 2024 18:04:41 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Cc: Jonathan Corbet , Vinod Koul Subject: [PATCH v1 1/3] dmaengine: acpi: Drop unused devm_acpi_dma_controller_free() Date: Mon, 7 Oct 2024 18:03:23 +0300 Message-ID: <20241007150436.2183575-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241007150436.2183575-1-andriy.shevchenko@linux.intel.com> References: <20241007150436.2183575-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 After introduction a few years ago the devm_acpi_dma_controller_free() was never used. Drop it. Signed-off-by: Andy Shevchenko --- Documentation/driver-api/driver-model/devres.rst | 1 - drivers/dma/acpi-dma.c | 15 --------------- include/linux/acpi_dma.h | 4 ---- 3 files changed, 20 deletions(-) diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst index 5f2ee8d717b1..f23dbe5d6606 100644 --- a/Documentation/driver-api/driver-model/devres.rst +++ b/Documentation/driver-api/driver-model/devres.rst @@ -459,7 +459,6 @@ SERDEV SLAVE DMA ENGINE devm_acpi_dma_controller_register() - devm_acpi_dma_controller_free() SPI devm_spi_alloc_master() diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c index a58a1600dd65..d5beb96ef510 100644 --- a/drivers/dma/acpi-dma.c +++ b/drivers/dma/acpi-dma.c @@ -276,21 +276,6 @@ int devm_acpi_dma_controller_register(struct device *dev, } EXPORT_SYMBOL_GPL(devm_acpi_dma_controller_register); -/** - * devm_acpi_dma_controller_free - resource managed acpi_dma_controller_free() - * @dev: device that is unregistering as DMA controller - * - * Unregister a DMA controller registered with - * devm_acpi_dma_controller_register(). Normally this function will not need to - * be called and the resource management code will ensure that the resource is - * freed. - */ -void devm_acpi_dma_controller_free(struct device *dev) -{ - WARN_ON(devres_release(dev, devm_acpi_dma_release, NULL, NULL)); -} -EXPORT_SYMBOL_GPL(devm_acpi_dma_controller_free); - /** * acpi_dma_update_dma_spec - prepare dma specifier to pass to translation function * @adma: struct acpi_dma of DMA controller diff --git a/include/linux/acpi_dma.h b/include/linux/acpi_dma.h index 72cedb916a9c..3ef1ec7a04cb 100644 --- a/include/linux/acpi_dma.h +++ b/include/linux/acpi_dma.h @@ -65,7 +65,6 @@ int devm_acpi_dma_controller_register(struct device *dev, struct dma_chan *(*acpi_dma_xlate) (struct acpi_dma_spec *, struct acpi_dma *), void *data); -void devm_acpi_dma_controller_free(struct device *dev); struct dma_chan *acpi_dma_request_slave_chan_by_index(struct device *dev, size_t index); @@ -94,9 +93,6 @@ static inline int devm_acpi_dma_controller_register(struct device *dev, { return -ENODEV; } -static inline void devm_acpi_dma_controller_free(struct device *dev) -{ -} static inline struct dma_chan *acpi_dma_request_slave_chan_by_index( struct device *dev, size_t index) From patchwork Mon Oct 7 15:03:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13824882 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5D531D88C6; Mon, 7 Oct 2024 15:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313488; cv=none; b=gmB74RntMgJshv+KM6dves8JHmy1UT5qLzGzI7JJGhcjhlEeEZ9yPPf5yAm3Je2BwGqWde8+2NSvtmZQX16H5SF7X17NNmSk38NuCNhUNSi9EjRtWnd+HA7yFj+A/49M0FEriKMMQbXm/kksiNSuwK0jV7TO7DM+L4/Jpm1pzug= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313488; c=relaxed/simple; bh=V6pWj5+cKd5iNf5dSk1Rts8AMVaHwFQZq+XBE2d4NiQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kxvEU9oS2Xb95HxBJyH+lSKcysBDRZZ0e/oGXqXWn2qtyGeO5BzobWjdicsq67FA4Hz1h+xzRKP9o3gubTKN0int6nosLmxiTqtITj9Z+PPkR1FjQ7Bd0dU8/y9/vO7adyeQRKNsGc5M42JUGbrTpgSEIffM+4u+7QXjBLbfHGI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=c2uOiJVI; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="c2uOiJVI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728313487; x=1759849487; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=V6pWj5+cKd5iNf5dSk1Rts8AMVaHwFQZq+XBE2d4NiQ=; b=c2uOiJVIjCdV/lRR0ZDVnhCGqV7GH2Bss390JNguXYxe5CbEEMPCSDVG yOZClaDNpZWOTc+YCfxExueusKSdyVnKiw/4lZa5/j9CBa1nkO5AGKLbd N6tbGGLKGnpCpk3D26d9y/WZic5kWUM1FHsIxia1A3cA+MliGEZYB5fUj T6Ky8rsK+VsbeHUA4MH+M/uduqTgAXXyesdPmHdXUAPuje+wy4zHp5uXB TJhmBf/Y56miqMS2a+dnBn3bYjNQJ8WKee8g/nDMSamJtEyfK28nggbTb tc5awDYTV4JSqSE8ZS55fI1flTDFJ+OchfcxBcViO0tjUID7INSoPBcTC g==; X-CSE-ConnectionGUID: 70V6lp0/Qbeh+0PLSEEDYw== X-CSE-MsgGUID: I/4/bavLRPyVT4T6soFt3g== X-IronPort-AV: E=McAfee;i="6700,10204,11218"; a="27593252" X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="27593252" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2024 08:04:45 -0700 X-CSE-ConnectionGUID: rlfJYJJ1TwmZgV+RFD5t/Q== X-CSE-MsgGUID: lhrCYT82R56GTWHaJAaboQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="75463529" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa009.jf.intel.com with ESMTP; 07 Oct 2024 08:04:43 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E18A237D; Mon, 07 Oct 2024 18:04:41 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Cc: Jonathan Corbet , Vinod Koul Subject: [PATCH v1 2/3] dmaengine: acpi: Simplify devm_acpi_dma_controller_register() Date: Mon, 7 Oct 2024 18:03:24 +0300 Message-ID: <20241007150436.2183575-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241007150436.2183575-1-andriy.shevchenko@linux.intel.com> References: <20241007150436.2183575-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use devm_add_action_or_reset() instead of devres_alloc() and devres_add(), which works the same. This will simplify the code. There is no functional changes. Signed-off-by: Andy Shevchenko --- drivers/dma/acpi-dma.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c index d5beb96ef510..f594ea265c76 100644 --- a/drivers/dma/acpi-dma.c +++ b/drivers/dma/acpi-dma.c @@ -236,7 +236,7 @@ int acpi_dma_controller_free(struct device *dev) } EXPORT_SYMBOL_GPL(acpi_dma_controller_free); -static void devm_acpi_dma_release(struct device *dev, void *res) +static void devm_acpi_dma_free(void *dev) { acpi_dma_controller_free(dev); } @@ -259,20 +259,13 @@ int devm_acpi_dma_controller_register(struct device *dev, (struct acpi_dma_spec *, struct acpi_dma *), void *data) { - void *res; int ret; - res = devres_alloc(devm_acpi_dma_release, 0, GFP_KERNEL); - if (!res) - return -ENOMEM; - ret = acpi_dma_controller_register(dev, acpi_dma_xlate, data); - if (ret) { - devres_free(res); + if (ret) return ret; - } - devres_add(dev, res); - return 0; + + return devm_add_action_or_reset(dev, devm_acpi_dma_free, dev); } EXPORT_SYMBOL_GPL(devm_acpi_dma_controller_register); From patchwork Mon Oct 7 15:03:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13824881 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79A261D86F0; Mon, 7 Oct 2024 15:04:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313487; cv=none; b=nnJjXTE2/UH6smiQyd/8B3SQSJDfhp2++SxvBH7UKAgmcielHZM6v+sqZn7wsYo0zD2ZFNFHDTWzTdMk4osRcx8x7swoBNZ8WtF/8ppO1Vlc7uC7ym7eB0+u8jWy1qMwkr0JuMFSNUT2HPaQ+WvYaJj4qxXa+Uwcc6b+3xKfBP4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728313487; c=relaxed/simple; bh=KJGY5oUBDjsW46vaPrEZIFU5m7FmsPsjEeFfIsxnDf0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hkffInEanGLtJCOUpSkZK/pYx6NDaSb7riyYylO21H9CdciCOjFAbghN6AY7+32HYpQpJblrQR2tGCNp3dBRHWCrJHjBew6dOKF+56qXrhMEsoqFx+yT75AFw4y9zS6BcE7ycNFlwjRG4A349PZ6spiJFzruS6f2YB+zLnhSfqU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MjzEQfvs; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MjzEQfvs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728313486; x=1759849486; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KJGY5oUBDjsW46vaPrEZIFU5m7FmsPsjEeFfIsxnDf0=; b=MjzEQfvsXY9FLRg4UymY94iAzgZXu02bcN6smRxH+iVd4QrZw6X3or9U JFUjEAjTmT+FSxpvtuthCPgdPztSY67jsYi7/UuEIwSsLEb8u9FKcJt11 FCdGlykCGTxT7/dpZ8+qbkqicMZuY4Ki1z5LVgsJerZ8/OehBQucSdE/N VHLlYMNCAEg6HkqWXvCSkZnnRYp7Y7Cj5KMnhpvmor87nP56amTxt8F4z HUDParwxwOMKMLGAYfsGgla9QutIg9cDIx1+JKV9u5xml6lSpb74P2n3L A4KZ6l3t+8kAvfJqAQ99I8YeH/COjf6VrgrnzAcMH1RLtH/WIBS1vcV4F A==; X-CSE-ConnectionGUID: CnNKpodwRaWDPU7C84oWSA== X-CSE-MsgGUID: YnC9A11oRbqaczckc75h5w== X-IronPort-AV: E=McAfee;i="6700,10204,11218"; a="27559140" X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="27559140" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2024 08:04:45 -0700 X-CSE-ConnectionGUID: /Kt3DdR5Tt2GesWcj7gIhQ== X-CSE-MsgGUID: HWdfjWETQVunGp0+xRivJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,184,1725346800"; d="scan'208";a="106342480" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa002.jf.intel.com with ESMTP; 07 Oct 2024 08:04:44 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0033B4FB; Mon, 07 Oct 2024 18:04:41 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Cc: Jonathan Corbet , Vinod Koul Subject: [PATCH v1 3/3] dmaengine: acpi: Clean up headers Date: Mon, 7 Oct 2024 18:03:25 +0300 Message-ID: <20241007150436.2183575-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241007150436.2183575-1-andriy.shevchenko@linux.intel.com> References: <20241007150436.2183575-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There is a few things done: - include only the headers we are direct user of - when pointer is in use, provide a forward declaration - add missing headers - sort alphabetically Signed-off-by: Andy Shevchenko --- drivers/dma/acpi-dma.c | 13 ++++++++----- include/linux/acpi_dma.h | 5 +++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c index f594ea265c76..2abbe11e797e 100644 --- a/drivers/dma/acpi-dma.c +++ b/drivers/dma/acpi-dma.c @@ -9,18 +9,21 @@ * Mika Westerberg */ +#include +#include #include #include #include -#include +#include +#include +#include #include #include #include -#include -#include -#include -#include #include +#include +#include +#include static LIST_HEAD(acpi_dma_list); static DEFINE_MUTEX(acpi_dma_lock); diff --git a/include/linux/acpi_dma.h b/include/linux/acpi_dma.h index 3ef1ec7a04cb..e748b2877602 100644 --- a/include/linux/acpi_dma.h +++ b/include/linux/acpi_dma.h @@ -11,10 +11,11 @@ #ifndef __LINUX_ACPI_DMA_H #define __LINUX_ACPI_DMA_H -#include -#include #include #include +#include + +struct device; /** * struct acpi_dma_spec - slave device DMA resources