Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6196954rwl; Wed, 22 Mar 2023 07:41:33 -0700 (PDT) X-Google-Smtp-Source: AK7set/d//pHecSBXwwT3iEJt0oMtnKKm7srnQf3PXgsHnvJJTMhCbvSnq3gR0NJUg+WU/DI3JXT X-Received: by 2002:a17:907:6d0e:b0:92e:e9c2:7b9e with SMTP id sa14-20020a1709076d0e00b0092ee9c27b9emr8595859ejc.41.1679496093206; Wed, 22 Mar 2023 07:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679496093; cv=none; d=google.com; s=arc-20160816; b=Sxapb3dQH8uho16CljAhGcnV4rex8P3yeW0IsU1w1d3NYCs8FqXIAWEeoy4GtEFmy/ FEmeZAFq3F4wngX66sbWxrFC3SF2oOCPGklC1QTbcbVpF/x43Yq/TePd77+I+PnIgef6 1107tGxuGEkAFo0V1QF6i+STOLduEE43LbacBg2KaJJbYbmdZIPI7Pwwv8ilAKRIvRbT moOCX8E+KDqpK8UZF0e/NAWFCHg4rZUPr1y9TBfmo+F4fcbsbGFoYPe3XstcETX8J+eH X8QAha6XHlkan9Vih4Rt7qLDlyfrgy1SPC9Mf9zBgX8fzN+YtekG8Hth7p58VLuCBiKJ MAQg== 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=fsciFlty20PbxlPCnUR8fW7k0aD6NrUN9era6wVY/jA=; b=BqVNy6Do8A0nKUzNSmMMPtCJXiYhc/LFZWKTliGhCttGP9Dt4NllC8aEZfsfpu/k2T R0At+ZsnRoHvD4i5bWLSo5+66H6hX+GOXoSEvBPAwHbLshQO7UeaeuIdvYvyVfindzY5 mKEy39JBKSZr/z/pIo0hVE5XLLjXbBUaa2KVclPdJFOEKSKk1Ep4GavB3SpMQAwMhhDS n4wMX0k4Da87XutRcXSZppuss6pW5oEnr4fY1rIxuDciCQw313XwH5bQcH8bwN4moXFI It68J2JWLHfSf2b+Px9S1CKJN9gy5NUmtof+jpitVnf+R8xtaiQJUTN07b61/QaOu/nK c9Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="d4PDK/Nk"; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u18-20020a1709063b9200b0093175b7c1e3si14598788ejf.870.2023.03.22.07.41.09; Wed, 22 Mar 2023 07:41:33 -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=@intel.com header.s=Intel header.b="d4PDK/Nk"; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231626AbjCVOjh (ORCPT + 99 others); Wed, 22 Mar 2023 10:39:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbjCVOjZ (ORCPT ); Wed, 22 Mar 2023 10:39:25 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66EA32A141 for ; Wed, 22 Mar 2023 07:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679495964; x=1711031964; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d4qGUtkkw/1Zx3uos2jaj6d4j/Os0XO1Iz7gJZdoh0U=; b=d4PDK/NkVXq0TApvuKjTPvIgFZXH7HTkvPm9mh3jEyEekbAAfTEEOzOB xjTsA3X1Yb+vtbq8dJy/mhjfZ2gRxhIHZF75Hb25YBAGnx55kHkOKTPXf z+M0aLjXjS5ixCwvRty0aFbIG/3dIYd7A4jjW8jkW+tK0ufBkfU6oqmh+ pOCsneLOEgqRW8cda6TW4smM0/tqIXqtpbBMlmbl8FcxbXDx2ZgsFcUlj DNgpr3bmjrrohdXWBvdzOS2gr30zJaJw2iZ38BZ1U/YdjABLvkeUod8Es Ji6M4eTmDR9JP91dsx93UNiRPp6SqrgyeamR2+Qjuz1gMc5qHmOggVooJ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="327609300" X-IronPort-AV: E=Sophos;i="5.98,282,1673942400"; d="scan'208";a="327609300" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2023 07:39:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="792579431" X-IronPort-AV: E=Sophos;i="5.98,282,1673942400"; d="scan'208";a="792579431" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 22 Mar 2023 07:39:22 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C092C638; Wed, 22 Mar 2023 16:40:06 +0200 (EET) From: Andy Shevchenko To: Bumwoo Lee , Andy Shevchenko , linux-kernel@vger.kernel.org Cc: MyungJoo Ham , Chanwoo Choi Subject: [PATCH v1 06/14] extcon: Allow name to be assigned outside of the framework Date: Wed, 22 Mar 2023 16:39:57 +0200 Message-Id: <20230322144005.40368-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230322144005.40368-1-andriy.shevchenko@linux.intel.com> References: <20230322144005.40368-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=unavailable 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 The documentation states that name of the extcon can be assigned outside of the framework, however code does something different. Fix the code to be aligned with the documentation. Signed-off-by: Andy Shevchenko --- drivers/extcon/extcon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index ac84f4aafc69..14e66e21597f 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -1269,10 +1269,10 @@ int extcon_dev_register(struct extcon_dev *edev) edev->dev.class = extcon_class; edev->dev.release = extcon_dev_release; - edev->name = dev_name(edev->dev.parent); - if (IS_ERR_OR_NULL(edev->name)) { - dev_err(&edev->dev, - "extcon device name is null\n"); + if (!edev->name) + edev->name = dev_name(edev->dev.parent); + if (!edev->name) { + dev_err(&edev->dev, "extcon device name is null\n"); return -EINVAL; } dev_set_name(&edev->dev, "extcon%lu", -- 2.40.0.1.gaa8946217a0b