From patchwork Tue Aug 11 15:41:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 250714 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1024DC433E1 for ; Tue, 11 Aug 2020 15:44:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE9AF2083B for ; Tue, 11 Aug 2020 15:44:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597160651; bh=LzLvznpcNnmXKzaflJxxBBaNzDaD/j3UH7gWllnn0ZU=; h=From:Cc:Subject:Date:In-Reply-To:References:To:List-ID:From; b=PLTyBsVYlWTkYUaPRh3ZX5cmlO5EUHdC0cQg2xuTymWVj2YaG79lOZRuScaWRpfh6 RYz+dcrk8cN7DxMrha1LXzUma7rFqGHhTqBkbaX/Zotau39v5NM/Z4q6xt3Vb/l+Iu DyQEkj5OVowYDP/LpqBQIwhWGy5IYMBiDwM0mhcM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729296AbgHKPoB (ORCPT ); Tue, 11 Aug 2020 11:44:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:47532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728915AbgHKPmF (ORCPT ); Tue, 11 Aug 2020 11:42:05 -0400 Received: from mail.kernel.org (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5FA4E208E4; Tue, 11 Aug 2020 15:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597160523; bh=LzLvznpcNnmXKzaflJxxBBaNzDaD/j3UH7gWllnn0ZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DKui9/+XGuQwiSMt7hhA2UApFZaLi40li6eRcVVck4P858dsHTK9EgBvA4R9Icab4 9ptLZaNgCr26XXmlOgWY4E83G1w1ui8fIVPt/k33VU1hsOBXC/WtpANpCbgOWL1wFJ SwTfxG6Pgyg1yMPzNAuxTqeoDNCYPzlfBw7STims= Received: from mchehab by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1k5WPZ-004bmZ-Hq; Tue, 11 Aug 2020 17:42:01 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Stephen Boyd , Mayulong , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/33] spmi: hisi-spmi-controller: fix it to probe successfully Date: Tue, 11 Aug 2020 17:41:34 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add a MODULE_DEVICE_TABLE() to the driver. Also, the current logic calls platform_set_drvdata(pdev, NULL) if the driver succeeds loading. While here, remove the .owner, as it is not needed upstream anymore. Signed-off-by: Mauro Carvalho Chehab --- drivers/spmi/hisi-spmi-controller.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/spmi/hisi-spmi-controller.c b/drivers/spmi/hisi-spmi-controller.c index 3af0bd1b379f..bc6847f9a5e7 100644 --- a/drivers/spmi/hisi-spmi-controller.c +++ b/drivers/spmi/hisi-spmi-controller.c @@ -324,11 +324,14 @@ static int spmi_controller_probe(struct platform_device *pdev) ctrl->write_cmd = spmi_write_cmd; ret = spmi_controller_add(ctrl); - if (ret) { - dev_err(&pdev->dev, "spmi_add_controller failed!\n"); + if (ret) goto err_add_controller; - } + + dev_info(&pdev->dev, "spmi_add_controller initialized\n"); + return 0; + err_add_controller: + dev_err(&pdev->dev, "spmi_add_controller failed!\n"); platform_set_drvdata(pdev, NULL); return ret; } @@ -347,13 +350,13 @@ static const struct of_device_id spmi_controller_match_table[] = { }, {} }; +MODULE_DEVICE_TABLE(of, spmi_controller_match_table); static struct platform_driver spmi_controller_driver = { .probe = spmi_controller_probe, .remove = spmi_del_controller, .driver = { .name = SPMI_CONTROLLER_NAME, - .owner = THIS_MODULE, .of_match_table = spmi_controller_match_table, }, };