From patchwork Mon Sep 23 10:06:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Billy Tsai X-Patchwork-Id: 830380 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (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 6F30E199225; Mon, 23 Sep 2024 10:06:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727085987; cv=none; b=icLvHXIp9Wkt/tSAlQ3hX/avM6SdLvVHweGRfx2MM4kiOa71UXPbZOFwoAhBhJkmh15IAhcMegv1ICWC7zGIKXd9eRNsq6PKzyeLMUymMoiOmjlKlOTg4/916uO/Ep4QvjaUA9aes4Nf8i9K3IioQw1HrbpDxTyRjaR6Xg2rkWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727085987; c=relaxed/simple; bh=+bcjZHVfyxSh7wPhZzT7LdI3CPCSw9yfhwXnOh0DmUs=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=M4FYyymNrTnSiq+GJNgq2ON7J5ksIEAXNh9090q6ivNngewvZpLEYl7bsjri1iFN8Thhl3KKb9Od2MVnbDMzERvtiVulrEODFlWaIsI+PDqTD8xUlNGkn3cE2IfUGaKgiWyjzgNs9BjpqNMaZaeNvJgZ5Jb9wEF7GaEIkCP+2O4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Mon, 23 Sep 2024 18:06:12 +0800 Received: from mail.aspeedtech.com (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Mon, 23 Sep 2024 18:06:12 +0800 From: Billy Tsai To: , , , , , , , , , , , , , , Subject: [PATCH v5 5/6] gpio: aspeed: Change the macro to support deferred probe Date: Mon, 23 Sep 2024 18:06:10 +0800 Message-ID: <20240923100611.1597113-6-billy_tsai@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240923100611.1597113-1-billy_tsai@aspeedtech.com> References: <20240923100611.1597113-1-billy_tsai@aspeedtech.com> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use module_platform_driver() to replace module_platform_driver_probe(). The former utilizes platform_driver_register(), which allows the driver to defer probing when it doesn't acquire the necessary resources due to probe order. In contrast, the latter uses __platform_driver_probe(), which includes the comment "Note that this is incompatible with deferred probing." Since our GPIO driver requires access to the clock resource, the former is more suitable. Signed-off-by: Billy Tsai --- drivers/gpio/gpio-aspeed.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index 7418d65be721..230af90aa966 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -1303,7 +1303,7 @@ static const struct of_device_id aspeed_gpio_of_table[] = { }; MODULE_DEVICE_TABLE(of, aspeed_gpio_of_table); -static int __init aspeed_gpio_probe(struct platform_device *pdev) +static int aspeed_gpio_probe(struct platform_device *pdev) { const struct of_device_id *gpio_id; struct gpio_irq_chip *girq; @@ -1404,13 +1404,14 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev) } static struct platform_driver aspeed_gpio_driver = { + .probe = aspeed_gpio_probe, .driver = { .name = KBUILD_MODNAME, .of_match_table = aspeed_gpio_of_table, }, }; -module_platform_driver_probe(aspeed_gpio_driver, aspeed_gpio_probe); +module_platform_driver(aspeed_gpio_driver); MODULE_DESCRIPTION("Aspeed GPIO Driver"); MODULE_LICENSE("GPL");