From patchwork Thu Mar 9 18:46:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 661912 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4597CC64EC4 for ; Thu, 9 Mar 2023 18:46:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229806AbjCISqP (ORCPT ); Thu, 9 Mar 2023 13:46:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbjCISqO (ORCPT ); Thu, 9 Mar 2023 13:46:14 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26530F9D32; Thu, 9 Mar 2023 10:46:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678387573; x=1709923573; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=MWfjkyFiaRXBagLW9d5hgMVgjJMLMDz/A3buAj1LPk4=; b=Qi8ixyQUO7if4sQMwstRcLLd8n6wtVWFxlGNi5Kmc3h1lgesicP4nyzD c3YeAWViu6N69BT/GfVyG75TRoiOnnT6aHnY5XoIvf/Jhk0QzjjFMuYMS dJL9uTWrOGdVU10G5pMxHqEWlVq9b44dDmTmORLn82XZuLFDKSyTJ/eCL DbOhYO9WtppvFEjDz0iXcb8PVL5I6HwmdN1kWkRYgfyt/n0L3Su6IMdpd yyae52naxpZoCoRkLeUq3DtaVkWQHf6Iak5dVhH2tIf5vZR7KBM5cafsc MHLWnIUPz9myzalVRpjpgJF2CAiMx6dKKgpKpjsFKNBhIOY//CMQ3W1/G A==; X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="334012434" X-IronPort-AV: E=Sophos;i="5.98,247,1673942400"; d="scan'208";a="334012434" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 10:45:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="801274606" X-IronPort-AV: E=Sophos;i="5.98,247,1673942400"; d="scan'208";a="801274606" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 09 Mar 2023 10:45:56 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0AFE2143; Thu, 9 Mar 2023 20:46:39 +0200 (EET) From: Andy Shevchenko To: Bartosz Golaszewski , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 1/2] gpio: sim: Deactivate device in reversed order Date: Thu, 9 Mar 2023 20:46:35 +0200 Message-Id: <20230309184636.84124-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Run the steps to deactivate device in the reserved order to what it has been done in gpio_sim_device_activate_unlocked(). Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index e5dfd636c63c..a1c8702f362c 100644 --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -953,9 +953,9 @@ static void gpio_sim_device_deactivate_unlocked(struct gpio_sim_device *dev) swnode = dev_fwnode(&dev->pdev->dev); platform_device_unregister(dev->pdev); + gpio_sim_remove_hogs(dev); gpio_sim_remove_swnode_recursive(swnode); dev->pdev = NULL; - gpio_sim_remove_hogs(dev); } static ssize_t From patchwork Thu Mar 9 18:46:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 661280 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE8B4C6FD19 for ; Thu, 9 Mar 2023 18:46:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230009AbjCISqP (ORCPT ); Thu, 9 Mar 2023 13:46:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbjCISqO (ORCPT ); Thu, 9 Mar 2023 13:46:14 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19B6FF9D3D; Thu, 9 Mar 2023 10:46:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678387574; x=1709923574; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Lpy9hKJnb/d+jy2NFBJN48EgZ0mPU6bdSBNhMxRwoiU=; b=kB2WhPRYc6tqwV7CTG3ZMaGCaNAlHrS7RX9CFdgcRRmoHTgmzVH9fx4Q 25dpfvp799d0sSMgtja2BnURpwQhDVLngZudP6OR+usJVzGPYa2vihs+V +DHoCCypKDYe8EJBk8p+ugPk7ZtXze6XksJZDLf5wah4TjrsrM+d8FcDt Z2rieMvXITMhuUW2Y4tqPo5oOEBZkkV/p3mNOhXgLn6W3+cDJHi1CDMQ3 +zd2lLsmnToDk/WWPv/zk70JvDqc53l7p6W4kqJgEgne2dqN6s6kQ4Ssf o1e3fsh1YyHZ2zxxmGehjrJ2g8hIWfU436t+Lkc/At66hwckQ9+twnfeE Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="334012443" X-IronPort-AV: E=Sophos;i="5.98,247,1673942400"; d="scan'208";a="334012443" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 10:45:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="801274607" X-IronPort-AV: E=Sophos;i="5.98,247,1673942400"; d="scan'208";a="801274607" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 09 Mar 2023 10:45:57 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 007B414F; Thu, 9 Mar 2023 20:46:40 +0200 (EET) From: Andy Shevchenko To: Bartosz Golaszewski , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 2/2] gpio: sim: Print boolean as unsigned integer Date: Thu, 9 Mar 2023 20:46:36 +0200 Message-Id: <20230309184636.84124-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230309184636.84124-1-andriy.shevchenko@linux.intel.com> References: <20230309184636.84124-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Print boolean as unsigned integer instead of using %c and manually converting to a character. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index a1c8702f362c..5ac1de5db751 100644 --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -684,7 +684,7 @@ gpio_sim_device_config_live_show(struct config_item *item, char *page) live = gpio_sim_device_is_live_unlocked(dev); mutex_unlock(&dev->lock); - return sprintf(page, "%c\n", live ? '1' : '0'); + return sprintf(page, "%u\n", live); } static char **gpio_sim_make_line_names(struct gpio_sim_bank *bank,