From patchwork Thu Oct 27 07:13:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 11623 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp81671wru; Thu, 27 Oct 2022 00:26:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5fALHDVUKhGBMpECUTo094OyhzvM2brMGCuX5rZPo37JlgWovoEQI74UWQQXn0WrC/Co2r X-Received: by 2002:a17:907:31c1:b0:742:28a3:5d08 with SMTP id xf1-20020a17090731c100b0074228a35d08mr40377043ejb.112.1666855564510; Thu, 27 Oct 2022 00:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666855564; cv=none; d=google.com; s=arc-20160816; b=xlUoB44P/MOct56rtk2V6sQvTy5FaOX1UdJc1d6y0wMkvzZm4aI/Isbi8XXXPTzc/w NJVNVacigIKAInfqg+LxtLY+JJYY/ITjHEO7btJvhL5xEM2dY84ZWXVEsxAUt5t8w6We J/rGvAHawqfld0HMV0IOy7naBybrqY+3Zf4+b8lSThbjDTCDl8hcppTKforWnpZu0v1l UbxK6Hf9i3O3Vot9MAHYYBgCfoajVQ2KCvLuO/qmx73YzmY+MZuwbLPe7x6nNywNjsNK p937yClasuUbz5MyCFMl9htTMIN9hqissFEGLk5tD2LbN5uAubxQnXIoJh6GWzQ3hKCa iUsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Z8uC60Lm5VPQvrMvRNF42R32uBkv9Pf19UWsJ/wtWPU=; b=gxwmFQMrKVOjmm/Yshx+4vgyk7YR4bgI7GY2fhbTSYklmRBCNg2v83EvCOp5l/ryqI i4gXIyJpBU7QDKbq5Ri6327PGuV+8Pab7v25IDwvEN21FZWKYtPFlUeqc7zIZhtR+lRo c9FcZSYBdRjO1sDKSWHwdTgjY8oL6TsER+Bf3IwV++7D1PTu7uTelD3ai5/8Em6iLBQx YEeqGK0FpddxKlg0Ug4hBphWmmB8WMRXCwG4a6x9FkAIiBpku65GAX5FFfUTq1tSVHiM nJ2ehrboQZpVCGKqLLBp9RSf41sHJFRY5iKERkALkqyovHrRniF4q+KoMsT53Y3PFssC LOMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QBgrM6yN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg3-20020a1709072cc300b0078da3218b54si677445ejc.171.2022.10.27.00.25.40; Thu, 27 Oct 2022 00:26:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QBgrM6yN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233687AbiJ0HOG (ORCPT + 99 others); Thu, 27 Oct 2022 03:14:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234475AbiJ0HN6 (ORCPT ); Thu, 27 Oct 2022 03:13:58 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5679A153E0F; Thu, 27 Oct 2022 00:13:57 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id l6so746576pjj.0; Thu, 27 Oct 2022 00:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=Z8uC60Lm5VPQvrMvRNF42R32uBkv9Pf19UWsJ/wtWPU=; b=QBgrM6yNGhTKdBH2jup/NAGiL/CLp/VY8VlvFR5+hlHOj+B6LhTkei9NtNa9+/vxF0 x84vsvtzspU4nnfkRt4O6p0fyq6BhXTVoh4dB7Uhs5GywQxCIrm3rXpCdF87l6vZMzdP U85dYCB4DJbGOJp1gQGQEqhgkhqJ2kFv5EWGnaV7Ym5vlq4rPB7VqsBI9B9g1ANMokuV odsDdFX6MB6QLKeelXmqCWRHzNZFCRVeRAaRsFtJFBIhxoDdXo59vIhyFfRa8UetLVAO /TBUkrJffERVJQ0BR4NsqgHkphQZfguBF9YH+kU5M0AeuL7nzjSsAN1D80IYTgJrCnT6 0uCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Z8uC60Lm5VPQvrMvRNF42R32uBkv9Pf19UWsJ/wtWPU=; b=s1c/c31OgnO1VS4b9AH1eakI0GThM6lQDX1Ulbm1F7ZbP5ljrxuxSDKnaV+g2VX8HG U9yaD5XdiLFFQPCigbCjI+duU7soKa8pH1sigatsc38IfZdr3nAJ3zprnoXHyXNX9dDC 6dMRRf7f1ChlLR/8MCorTflegYN2TieG8lGf+lpVF2ZndRaFIKRZxM+chXE9pY8Mwl8r QdBdR64o0UwTuQ0xHoe9OBfhhmC7F+iAw+NfMjqPzY59m8gp5GS2l7UGqsRrPVu2r/mv A9UkrLQrQ+pB88AX1Vwc+8kn1LVQ+FsCG5hEXsTqlta6E0ILO2+WtNljSky9ilf37OjQ PFeQ== X-Gm-Message-State: ACrzQf3rkKPZYE2c9UeC9OohoLD9ny8YtJQrw98Hw+GdwWcCq+I3IqDH yrRBOqS2pox9sqmQnlHmDXaIpbzN7bs= X-Received: by 2002:a17:902:ef52:b0:17c:f072:95bc with SMTP id e18-20020a170902ef5200b0017cf07295bcmr6845576plx.28.1666854836693; Thu, 27 Oct 2022 00:13:56 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:99d6:ae15:f9aa:1819]) by smtp.gmail.com with ESMTPSA id je11-20020a170903264b00b00186ac812ab0sm496321plb.83.2022.10.27.00.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 00:13:55 -0700 (PDT) From: Dmitry Torokhov To: Peter Huewe , Jarkko Sakkinen Cc: Jason Gunthorpe , linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/3] tpm: st33zp24: remove pointless checks on probe Date: Thu, 27 Oct 2022 00:13:49 -0700 Message-Id: <20221027071349.991730-3-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog In-Reply-To: <20221027071349.991730-1-dmitry.torokhov@gmail.com> References: <20221027071349.991730-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747824740433824975?= X-GMAIL-MSGID: =?utf-8?q?1747824740433824975?= Remove tests for SPI device or I2C client to be non-NULL because driver core will never call driver's probe method without having a valid device structure. Signed-off-by: Dmitry Torokhov Reviewed-by: Jarkko Sakkinen --- v3: no changes v2: reworked commit message drivers/char/tpm/st33zp24/i2c.c | 6 ------ drivers/char/tpm/st33zp24/spi.c | 7 ------- 2 files changed, 13 deletions(-) diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c index 614c7d8ed84f..8156bb2af78c 100644 --- a/drivers/char/tpm/st33zp24/i2c.c +++ b/drivers/char/tpm/st33zp24/i2c.c @@ -106,12 +106,6 @@ static int st33zp24_i2c_probe(struct i2c_client *client, { struct st33zp24_i2c_phy *phy; - if (!client) { - pr_info("%s: i2c client is NULL. Device not accessible.\n", - __func__); - return -ENODEV; - } - if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { dev_info(&client->dev, "client not i2c capable\n"); return -ENODEV; diff --git a/drivers/char/tpm/st33zp24/spi.c b/drivers/char/tpm/st33zp24/spi.c index 25b0e7994d27..c249d3f964fd 100644 --- a/drivers/char/tpm/st33zp24/spi.c +++ b/drivers/char/tpm/st33zp24/spi.c @@ -223,13 +223,6 @@ static int st33zp24_spi_probe(struct spi_device *dev) { struct st33zp24_spi_phy *phy; - /* Check SPI platform functionnalities */ - if (!dev) { - pr_info("%s: dev is NULL. Device is not accessible.\n", - __func__); - return -ENODEV; - } - phy = devm_kzalloc(&dev->dev, sizeof(struct st33zp24_spi_phy), GFP_KERNEL); if (!phy)