From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 62FC9C47082 for ; Mon, 7 Jun 2021 13:39:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4961361185 for ; Mon, 7 Jun 2021 13:39:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230394AbhFGNls (ORCPT ); Mon, 7 Jun 2021 09:41:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230378AbhFGNlr (ORCPT ); Mon, 7 Jun 2021 09:41:47 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 259FFC061766 for ; Mon, 7 Jun 2021 06:39:56 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id y2so24920126ybq.13 for ; Mon, 07 Jun 2021 06:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VlXDuzHKluTkhD5zvNM3nuwm1YIsxipLM0a14l1XdN4=; b=n8zru0ajQmXsS/hEV3K5YVM3VTbwv84fG1iqwEZFzABWmUcpIeP4t4ig/EFDRd9yDA eZB48b6Ly6VNPnXr73amlDSMG0r/VezuhvcsKSFpah8S2e7lKfvs/qGWGGamaPumOifr zFEqSwx6HmC+e/Bpv1U5ZgvSEffPWaOh4aOlFeOS0Nzc2+bb4K9M4ZW0pTnKzlRp/YBr SqrS4PmCxyL1Rdwj8rOA9V/hbBEuNKtYHvq4VvrLr+7CRk1fzh7Ow23flTk5JsDw1v/2 noPrzfDIyrwMiyxoRJruQXw3fpyOwEEg1+KQZl9NLomTE/ZYSQkVpi4CXrsguCnf+cib oy1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VlXDuzHKluTkhD5zvNM3nuwm1YIsxipLM0a14l1XdN4=; b=Odj2lKqaT/+6h203prlLyHjxNAY/00B8TDsPLiPOSpJb/7Gn5hfUgucojGlDom6aCa B3j3P+xGWgZT5dCZaUiQTExGyPcSSK7nb1PdrfTV/SNqGSbhQ2+I1Po+gpVBWIGY8Nxg l0j8SzcPqWk97gTuBocRPtvwJ2NS+5jbHTbYfBs6yziQnfOLaAo168pyKuhknv6BUPen Fo/ACh2UJ5GAYAs3kESPhQ2zh+ZfWI3l1gKoDSDdFAph4E1pmnioOI6AwNxXDOp4oPU9 Dy9dySu2h5kMxOu+ug5RL53zFz1oRYfeYezkiXSSz7lYDn3mC4cM1bCtmArmAstX6io+ xUXw== X-Gm-Message-State: AOAM533dCc5dNbw8zbyjX7b92Bs7Ob/KTO5B+/I9kcOvXa4g4ddSuDlh BYpaSkb8X6ISq8efXbvAiAwUHnRsDx0BlCKzj2a/ZQ== X-Google-Smtp-Source: ABdhPJzKoUs8qoJEnd+R+x3/KSsW2OZ2yeBPW9osZaSI2IxCBvJQovcJAFCC/EHEVBIfwR4ko42JMpDGASzHS094hfM= X-Received: by 2002:a25:1ec2:: with SMTP id e185mr23958988ybe.23.1623073195494; Mon, 07 Jun 2021 06:39:55 -0700 (PDT) MIME-Version: 1.0 References: <20210604225857.18694-1-michael@walle.cc> In-Reply-To: <20210604225857.18694-1-michael@walle.cc> From: Bartosz Golaszewski Date: Mon, 7 Jun 2021 15:39:44 +0200 Message-ID: Subject: Re: [PATCH v2] gpio: regmap: move drvdata to config data To: Michael Walle Cc: linux-gpio , LKML , Linus Walleij , Matti Vaittinen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 5, 2021 at 1:01 AM Michael Walle wrote: > > Drop gpio_regmap_set_drvdata() and instead add it to the configuration > data passed to gpio_regmap_register(). > > gpio_regmap_set_drvdata() can't really be used in a race free way. This > is because the gpio_regmap object which is needed by _set_drvdata() is > returned by gpio_regmap_register(). On the other hand, the callbacks > which use the drvdata might already be called right after the > gpiochip_add() call in gpio_regmap_register(). Therefore, we have to > provide the drvdata early before we call gpiochip_add(). > > Signed-off-by: Matti Vaittinen > Signed-off-by: Michael Walle > Reviewed-by: Linus Walleij > --- Applied, thanks! Bart