Fix a recursive inclusion (merge headers) 32/258432/1
authorMichal Bloch <m.bloch@samsung.com>
Mon, 17 May 2021 18:13:06 +0000 (20:13 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Mon, 17 May 2021 18:21:34 +0000 (20:21 +0200)
<peripheral_handle.h> would include <peripheral_handle_common.h>
and <peripheral_handle_common.h> would include <peripheral_handle.h>,
leaving anybody including either with both. Simplify this via merge.

Change-Id: I48f3f54284cc1e521a36b4ea7d025ab8f7d5da45
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
include/handle/peripheral_handle.h
include/handle/peripheral_handle_common.h [deleted file]
src/handle/peripheral_handle_adc.c
src/handle/peripheral_handle_common.c
src/handle/peripheral_handle_gpio.c
src/handle/peripheral_handle_i2c.c
src/handle/peripheral_handle_pwm.c
src/handle/peripheral_handle_spi.c
src/handle/peripheral_handle_uart.c

index 2f1336df58cb6d5aa7081691ebc8c0c78a821e9e..66e12696a808e3e9b1ff5cd103481440f5b33589 100644 (file)
 
 #include <gio/gio.h>
 #include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
 
 #include "peripheral_board.h"
+#include "peripheral_io.h"
 #include "peripheral_io_gdbus.h"
+#include "peripheral_log.h"
 
 typedef struct {
        pb_board_s *board;
@@ -88,5 +92,8 @@ typedef peripheral_handle_s *peripheral_h;
 
 #define PERIPHERAL_H_TO_ID(ph) ((ph) ? (ph->handle_id) : 0)
 
-#include "peripheral_handle_common.h"
+peripheral_h peripheral_handle_new(GList **plist);
+int peripheral_handle_free(peripheral_h handle);
+peripheral_h peripheral_handle_find(GList *list, uint32_t _handle_id);
+
 #endif /* __PERIPHERAL_HANDLE_H__ */
diff --git a/include/handle/peripheral_handle_common.h b/include/handle/peripheral_handle_common.h
deleted file mode 100644 (file)
index ff2ff23..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __PERIPHERAL_HANDLE_COMMON_H__
-#define __PERIPHERAL_HANDLE_COMMON_H__
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <gio/gio.h>
-#include <peripheral_io.h>
-
-#include "peripheral_handle.h"
-#include "peripheral_log.h"
-
-peripheral_h peripheral_handle_new(GList **plist);
-int peripheral_handle_free(peripheral_h handle);
-peripheral_h peripheral_handle_find(GList *list, uint32_t _handle_id);
-
-#endif /* __PERIPHERAL_HANDLE_COMMON_H__ */
index 7147d0e2dfac5a2536bcdd239939ce2c6a041a01..7e71e1aa2e8083d387aa4eda97a990bf9825b0bd 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "peripheral_handle_common.h"
+#include "peripheral_handle.h"
 
 static bool __peripheral_handle_adc_is_creatable(int device, int channel, peripheral_info_s *info)
 {
index e8c8598e90c222d91baf13e258cb71487f87d7ed..623fbfa85117dffedb8752ae94747be3d80183eb 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <stdlib.h>
 
-#include "peripheral_handle_common.h"
+#include "peripheral_handle.h"
 
 gint cmp_handle(gconstpointer elem, gconstpointer _handle_id)
 {
index 7f793f53f767e53f75d9ad49278ba0ea9b342a54..eb5f2d1eed7b9cbd515ee11ce813853b9a9244dd 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "peripheral_handle_common.h"
+#include "peripheral_handle.h"
 
 static bool __peripheral_handle_gpio_is_creatable(int pin, peripheral_info_s *info)
 {
index 3294a8b47335baa8c58fcf93c1672915ed9ebcdc..8bce082a0be5c52557a67d95821054fc747c146f 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "peripheral_handle_common.h"
+#include "peripheral_handle.h"
 
 static bool __peripheral_handle_i2c_is_creatable(int bus, int address, peripheral_info_s *info)
 {
index 501245e0a19c0cdc5e7ef3758c09aefe5a3f34e5..c914ad953fa04e92b1f1b3cf2b972d39bf8ebb9c 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "peripheral_handle_common.h"
+#include "peripheral_handle.h"
 
 static bool __peripheral_handle_pwm_is_creatable(int chip, int pin, peripheral_info_s *info)
 {
index 727fde3bec61579f32cd51818adc34392eceb8eb..7d49349ed3710ebe5239feebd1fa9a0349e283ea 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "peripheral_handle_common.h"
+#include "peripheral_handle.h"
 
 static bool __peripheral_handle_spi_is_creatable(int bus, int cs, peripheral_info_s *info)
 {
index c6f0e0ddade5edd91828cdaa045cc4c46dbb883f..6426f0099121100f4725590d1df11b9ba4556a9e 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "peripheral_handle_common.h"
+#include "peripheral_handle.h"
 
 static bool __peripheral_handle_uart_is_creatable(int port, peripheral_info_s *info)
 {