Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3467502pxb; Mon, 4 Apr 2022 17:55:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzktZbBftDmOod6CsJQXWHOVxBHOBRiltBG9xfyajFW65zdmz9oj1Mvnd7MycNaC0noBsFe X-Received: by 2002:aa7:9019:0:b0:4fa:7532:9551 with SMTP id m25-20020aa79019000000b004fa75329551mr826446pfo.26.1649120128330; Mon, 04 Apr 2022 17:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649120128; cv=none; d=google.com; s=arc-20160816; b=X8NqYrNVHGCjwgt8lFbZvZDWdntpaQ2Et94OUkxl8JooDdEpvDXKl+QXmwujKrtI6t aOOJqpcMbetDJLjrl69iLWt5VQwJoLfDL/gDN1WVkEk7qKdExwd4YmuU2siYvOvsWY18 Wa83DL8M+KiteXS/43sOJ2KK+8WNAZ94DNBe4iv9iqr4Wr9R+wV8WlyiJwFwYCbnC0QA 9Js4033FgEJyEAayVE1hWiMIkBncwxJ4dH5ylQjwSbg/jAP4EvuivMN9KFARtCrWH87Z Y7M9GuKUas8SuOzQcVWnWLi6ayZvFjE72R8xzD971LHej4fxEO9HY8IalDZWSy3cdd/r YGTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=mmN7qtmnz9zJj+1xO5pDRuU70Xzo2jJcKr0sswtR2JA=; b=ZAg5QKVx8Hj8qQiOKgwe5tMT8C0Y1gyUFC4xDM8P0m6Drq9QcRkD3yGD1H5Tecg62j Z+hnPtZW2srRYHuIE2+MoMbCyG61p829YCWYBWZlD943ibvF0dTMvfPGnTOmKueQy0Ln hyNTcsO45Bk46qapFDzMcjW0YU//oCBXScIhZkuT+dUJnexpq6CkVrF3DEJiK+Bi3xoV eYfhP9BWjW5JaeR+LOEmTZi94IEkaw3271Z87Gwm/OiMFhaQHlj1ZQCsocmQdncAFGPy Zpm7ubLEF9v3n3ijJXx0aoP2sHOQv/7M3PkSoYw3BGHrNmGLovrQ8fpQSJ5K+lF6kq8k YkzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=YhYyGtNT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u11-20020a17090341cb00b00153f7e1559dsi11497446ple.55.2022.04.04.17.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 17:55:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=YhYyGtNT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2660E11CF4B; Mon, 4 Apr 2022 17:02:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347408AbiDDENX (ORCPT + 99 others); Mon, 4 Apr 2022 00:13:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233038AbiDDENQ (ORCPT ); Mon, 4 Apr 2022 00:13:16 -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 2D11715A06 for ; Sun, 3 Apr 2022 21:11:22 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id a16-20020a17090a6d9000b001c7d6c1bb13so7848839pjk.4 for ; Sun, 03 Apr 2022 21:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mmN7qtmnz9zJj+1xO5pDRuU70Xzo2jJcKr0sswtR2JA=; b=YhYyGtNTV+WpURFXebyNjUmPMblXNGgVGmDeL/ONC6eWKIhn3ZxB+jPYb//rCIdBNf u61GoO3kMvMBPqukrOIsONqSM5SvtOGiCLoPoqF3osM2bvjo6wGDQiI3FBOunsXFeUwd Mi05Gg7bCXubuHuKbvwdO6+/6jXTuGgdco2xFaUXf514EbMe6Tbm5XgYPRcBnmk+xPOW l2KL7mMZnjeR2jpkGt2d+QsOuj+Q4jyEPaPdeYSzB1W7ZRSKfScyn9DXOObWtjuz1iuj KfluTkS3dRUVj/oMhONDVj2Iak0G9I363XaZU/pxaZ+4T5PRpDNCEI0eQvysr6wZSvUv FCUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mmN7qtmnz9zJj+1xO5pDRuU70Xzo2jJcKr0sswtR2JA=; b=j1emYZ7Iqvp0qaH/wBrZD+pSBlRFVLxuwCUjNPs1dnJ2CIFXf1ESmFNGV4RUn4ap9r vQi/LL/vJMZK99A9wBSN3F6YmsDxtbMdeCuqprW2c/oGwLzL7TH0Ru4wFfJ/SE1YSvEr k9KiVtOZguHrdxjov6IsBswIaOwJuH+U7Pefhcyrc/Ja+g+/yDydjYUvq1zZxFqvmyN9 M2vSmAfClGq8/OD6rtpop1WtvREXAHL6AJ+kSqorhB3yAhYKH/dmzrw54xb1eYUvSmic M5+vJW1NQbrNEsy0o96rddf1abd4NcIpBzDf8MexZLezh+qLBQsK66FQwTbZAUHw3ef6 cnNg== X-Gm-Message-State: AOAM531ftVMKUtIQQ1u7CqcDAIj7AF/FI2FO/bfNXbqbjgtz/UVz9KKi DLNIcpYjWY9+9eVEcV7xA+MrMAmcnuI= X-Received: by 2002:a17:902:ce90:b0:154:3029:97e6 with SMTP id f16-20020a170902ce9000b00154302997e6mr20863385plg.111.1649045481102; Sun, 03 Apr 2022 21:11:21 -0700 (PDT) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id x123-20020a623181000000b004fdf99d25f6sm2882641pfx.80.2022.04.03.21.11.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Apr 2022 21:11:20 -0700 (PDT) From: Akihiko Odaki Cc: linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev, Prashant Malani , Benson Leung , Guenter Roeck , Akihiko Odaki Subject: [PATCH] platform/chrome: cros_ec_typec: Check for EC driver Date: Mon, 4 Apr 2022 13:11:01 +0900 Message-Id: <20220404041101.6276-1-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,SPOOFED_FREEMAIL_NO_RDNS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The EC driver may not be initialized when cros_typec_probe is called, particulary when CONFIG_CROS_EC_CHARDEV=m. Signed-off-by: Akihiko Odaki --- drivers/platform/chrome/cros_ec_typec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c index 4bd2752c0823..7cb2e35c4ded 100644 --- a/drivers/platform/chrome/cros_ec_typec.c +++ b/drivers/platform/chrome/cros_ec_typec.c @@ -1084,6 +1084,9 @@ static int cros_typec_probe(struct platform_device *pdev) } ec_dev = dev_get_drvdata(&typec->ec->ec->dev); + if (!ec_dev) + return -EPROBE_DEFER; + typec->typec_cmd_supported = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_CMD); typec->needs_mux_ack = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK); -- 2.35.1